0.2.1-alpha • Published 3 years ago

parrier v0.2.1-alpha

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

-----------------------------------------------------

Welcome to parrier

GitHub package.json version Prerequisite Prerequisite Documentation Maintenance License: MIT

Actions Status

This is a package that lists everything inside the provided "path" (or the full tree structure if "recurse" is set), asynchronously.

Gif showing software working

Homepage

Demo

-----------------------------------------------------

Table of Contents

-----------------------------------------------------

Prerequisites

  • node: >=8.0.0
  • npm: >=5.0.0

-----------------------------------------------------

Install

npm install parrier

-----------------------------------------------------

Usage

Async / await example

/**
 * 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

/**
 * 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

npm run test

-----------------------------------------------------

Author

jruipinto

-----------------------------------------------------

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also take a look at the contributing guide.

-----------------------------------------------------

References

-----------------------------------------------------

Show your support

Give a ⭐️ if this project helped you!

-----------------------------------------------------

License

Copyright © 2021 jruipinto.

This project is MIT licensed.