parrier
Version:
This is a package that lists everything inside the provided "path" (or the full tree structure if "recurse" is set), asynchronously.
168 lines (99 loc) • 5.18 kB
Markdown
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
[](#welcome-to--pkgname-)
# Welcome to parrier



[](https://jruipinto.github.io/parrier/)
[](https://github.com/jruipinto/parrier/graphs/commit-activity)
[](https://github.com/jruipinto/parrier/blob/master/LICENSE)
[](https://github.com/jruipinto/parrier/actions)
> This is a package that lists everything inside the provided "path" (or the full tree structure if "recurse" is set), asynchronously.

[Homepage](https://jruipinto.github.io/parrier/)
[Demo](https://repl.it/@jruipinto/parrier-demo#index.js)
[](#table-of-contents)
## Table of Contents
* [Welcome to parrier](#welcome-to-parrier)
* [Prerequisites](#prerequisites)
* [Install](#install)
* [Usage](#usage)
* [Async / await example](#async--await-example)
* [Promise example](#promise-example)
* [Run tests](#run-tests)
* [Author](#author)
* [Contributing](#contributing)
* [References](#references)
* [Show your support](#show-your-support)
* [License](#license)
[](#prerequisites)
## Prerequisites
* **node**: >=8.0.0
* **npm**: >=5.0.0
[](#install)
## Install
```sh
npm install parrier
```
[](#usage)
## Usage
### Async / await example
```js
/**
* 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 example
```js
/**
* 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));
```
[](#run-tests)
## Run tests
```sh
npm run test
```
[](#author)
## Author
**jruipinto**
- GitHub: [@jruipinto](https://github.com/jruipinto)
- LinkedIn: [https://pt.linkedin.com/in/j-rui-pinto](https://pt.linkedin.com/in/j-rui-pinto)
[](#contributing)
## Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/jruipinto/parrier/issues). You can also take a look at the [contributing guide](https://github.com/jruipinto/parrier/blob/master/CONTRIBUTING.md).
[](#references)
## References
- Package name generated with [Namelix](https://namelix.com)
- Readme generated with [@appnest/readme](https://github.com/andreasbm/readme)
[](#show-your-support)
## Show your support
Give a ⭐️ if this project helped you!
[](#license)
## License
Copyright © 2021 [jruipinto](https://github.com/jruipinto).
This project is [MIT](https://github.com/jruipinto/parrier/blob/master/LICENSE) licensed.