https://github.com/rumkin/dir-array
Node.js package presenting directory as Array.
https://github.com/rumkin/dir-array
Last synced: 11 months ago
JSON representation
Node.js package presenting directory as Array.
- Host: GitHub
- URL: https://github.com/rumkin/dir-array
- Owner: rumkin
- License: mit
- Created: 2016-05-25T13:32:20.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-12T11:41:58.000Z (almost 10 years ago)
- Last Synced: 2025-07-02T23:41:42.161Z (12 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Dir Array
Present requested directory as array of file names.
## Installation
Intall via npm
```
npm i dir-array
```
## Usage
Package directory:
```
.
|-- package.json
|-- readme.md
|-- src
| `-- dir-array.js
`-- test
`-- test.spec.js
```
Code:
```javascript
const DirArray = require('dir-array');
var cwd = new DirArray(process.cwd());
cwd; // => ['src', 'test', 'package.json', 'readme.md']
var test = cwd.dir('test');
test; // => ['test.spec.js']
```
## License
MIT license