1.0.2 • Published 5 years ago
simply-get-files v1.0.2
simply-get-files
Recursively get all the files in a directory.
const getFiles = require('simply-get-files');
(async function() {
const files = await getFiles(`static`);
// -> [ `global.css`, `fonts/font1.woff`, `images/background.png`, `images/web/small/loading.gif`]
})();
See test/index.js
for more information.
API
getFiles(directory?: string) => Promise<string[]>
The default directory is process.cwd()
.
If the directory does not exist, an empty array is returned.
This package only returns the files in a directory. Empty folders are ignored.