ls-all

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i ls-all

Weekly Downloads

19

Version

1.1.0

License

MIT

Last publish

Collaborators

  • cantidio