1.0.2 • Published 7 years ago

readdirsync2 v1.0.2

Weekly downloads
42
License
MIT
Repository
github
Last release
7 years ago

Installation

npm install readdirsync2 --save

Example

Basic usage

const readdirSync = require('readdirsync2');
readdirSync('./foo/bar');

Get only files

readdirSync('./foo/bar', {only: 'file'});

Get only directories

readdirSync('./foo/bar', {only: 'directory'});

Disable recursive mode

readdirSync('./foo/bar', {recursive: false});

Ignore files with extension

readdirSync('./foo/bar', {ignoreExt: ['.js', '.txt']});

Ignore files or directories with name

readdirSync('./foo/bar', {ignoreName: ['index.js', 'my-folder']});

API

readdirSync(dir, opts) ⇒ Array

Read directory content

Kind: global function

Changelog

You can view the changelog here

License

readdirsync2 is open-sourced software licensed under the MIT license

Authors

Fabio Ricali