ls-all

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

MIT 5 个版本
安装
npm install ls-all
yarn add ls-all
pnpm add ls-all
bun add ls-all
README

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

版本列表
1.1.0 2016-03-25
1.0.2 2016-03-24
1.0.1 2016-03-24
1.0.0 2016-03-24
0.1.0 2016-03-23