1.1.0 • Published 8 years ago

ls-all v1.1.0

Weekly downloads
98
License
MIT
Repository
github
Last release
8 years ago

NPM

Build Status Code Climate Test Coverage Dependencies devDependencies Status

LS-ALL

A simplistic deep file listing module for node (ls -Rla)

Install

  npm install --save ls-all

Usage

CLI

  ls-all --help
  Usage
    $ ls-all [options] ...folders

    Options
    -f, --flatten
    -r, --recurse

  Examples
    $ ls-all ./folder-1 ./folder-2
      folder-1:
        file-1
        file-2

List all files in a dir. Recursive optional. Flatten optional.

API

list(paths, options)

Returns a promise with an array of files.

options

Type: object

  • recurse: true|false
  • flatten: true|false

Examples

const list = require('ls-all');
list([
  './src',
  './tests'
], { recurse: true }).then((files)=>{
  console.log('files');
  console.log(JSON.stringify(files,null,2));
});

Logs the file tree of the given paths.

License

MIT