Package Exports
- list-directories
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 (list-directories) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
list-directories
List all directories in a given directory
const listDirectories = require('list-directories');
/*
./my-dir/a: file
./my-dir/b: directory
./my-dir/c: symlink to a directory
./my-dir/d: directory
*/
async (() => {
await listDirectory('my-dir');
/* Set {
'/Users/example/my-dir/b.txt',
'/Users/example/my-dir/d.txt'
} */
});
Installation
npm install list-directories
API
const listDirectories = require('list-directories');
listDirectories(dir)
dir: string
(directory path)
Return: Promise<Set<string>>
The promise will be fulfilled with a Set
of strings — absolute paths of all directories included in the given directory.