parrier
TypeScript icon, indicating that this package has built-in type declarations

0.2.1-alpha • Public • Published

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

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.

Package Sidebar

Install

npm i parrier

Weekly Downloads

1

Version

0.2.1-alpha

License

MIT

Unpacked Size

23.4 kB

Total Files

24

Last publish

Collaborators

  • jruipinto