JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q56484F
  • License MIT

Deeply lists given directory

Package Exports

  • deep-list-dir

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (deep-list-dir) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

deep-list-dir

Deeply lists a directory filtering files by given pattern(s)

Version tests

This module deeply lists all files in given directory (including sub-folders) by early filtering the results using the given pattern which can be an array of minimatch expressions or RegExp.

Example

Take the following file structure:

<directory>
├── dir1
│   └── README.md
├── dir2
│   └── sub-dir2
│   │   └── hi.txt
│   │   └── index.js
├── index.js
└── README.md

And the following script:

const { deepListDir } = require('deep-list-dir')
deepListDir('<directory>',
  {
    pattern: ['*.md'], // minimatch or RegExp
    // minimatchOptions: { matchBase: true } // minimatch options
  }
).then(console.log) // => ['<directory>/dir1/README.md', '<directory>/README.md']

License

MIT

© 2020-present Martin Rafael Gonzalez tin@devtin.io