Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/home-files
List all files in the home directory
https://github.com/shinnn/home-files
async enumeration home javascript list nodejs promise
Last synced: 27 days ago
JSON representation
List all files in the home directory
- Host: GitHub
- URL: https://github.com/shinnn/home-files
- Owner: shinnn
- License: isc
- Created: 2017-05-18T12:56:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T06:37:56.000Z (almost 7 years ago)
- Last Synced: 2024-10-13T18:57:17.512Z (about 1 month ago)
- Topics: async, enumeration, home, javascript, list, nodejs, promise
- Language: JavaScript
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# home-files
[![npm version](https://img.shields.io/npm/v/home-files.svg)](https://www.npmjs.com/package/home-files)
[![Build Status](https://travis-ci.org/shinnn/home-files.svg?branch=master)](https://travis-ci.org/shinnn/home-files)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/home-files.svg)](https://coveralls.io/github/shinnn/home-files?branch=master)List all files in the [home directory](https://nodejs.org/api/os.html#os_os_homedir)
```javascript
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](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).
```
npm install home-files
```## API
```javascript
const homeFiles = require('home-files');
```### homeFiles([*options*])
*options*: `Object` (used as [`readdir-sorted` options](https://github.com/shinnn/readdir-sorted#readdirsortedpath--options))
Return: `Promise>`The promise will be fulfilled with a [`Set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/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`](https://github.com/shinnn/readdir-sorted) to control the order of results.
## License
[ISC License](./LICENSE) © 2017 - 2018 Shinnosuke Watanabe