This is a package that lists everything inside the provided "path" (or the full tree structure if "recurse" is set), asynchronously.
npm install parrier
/**
* Async / await
*/
const parrier = require('parrier');
// import parrier from 'parrier'; // for typescript
const path = './example-folder/';
(() => {
try {
async () => {
const folderContent = await parrier(path);
console.log(folderContent); // logs an array of IFile
// IFile is a typescript interface (of this package)
// that represents the file object (including
// file.name, file.extension, file.isFile, etc...)
// refer to API to know more
};
} catch (err) {
console.log(err.message);
}
})();
/**
* Promise
*/
const parrier = require('parrier');
// import parrier from 'parrier'; // for typescript
const path = './example-folder/';
parrier(path)
.then((folderContent) => console.log(folderContent))
.catch((err) => console.log(err.message));
Follow this link to check the API
Follow this link to check the Changelog
jruipinto
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
Copyright © 2021 jruipinto.
This project is MIT licensed.
Generated using TypeDoc