home-files

List all files in the home directory

Usage no npm install needed!

<script type="module">
  import homeFiles from 'https://cdn.skypack.dev/home-files';
</script>

README

home-files

npm version Build Status Coverage Status

List all files in the home directory

const homeFiles = require('home-files');

(async () => await homeFiles() /* => Set {
  '/Users/shinnn/.DS_Store',
  '/Users/shinnn/.bash_history',
  '/Users/shinnn/.bash_profile',
  '/Users/shinnn/.bashrc',
  '/Users/shinnn/.gitconfig',
  ...
  '/Users/shinnn/.zshrc'
} */)();

Installation

Use npm.

npm install home-files

API

const homeFiles = require('home-files');

homeFiles([options])

options: Object (used as readdir-sorted options)
Return: Promise<Set<string>>

The promise will be fulfilled with a Set of strings — absolute paths of all files included in the home directory. Symbolic links and directories are excluded.

Options are directly passed to the underlying readdir-sorted to control the order of results.

License

ISC License © 2017 - 2018 Shinnosuke Watanabe