Skip to content

mgenware/dir-contents-object

Repository files navigation

dir-contents-object

Build Status npm version Node.js Version

Convert the contents of a directory to an object.

Installation

npm i dir-contents-object

Usage

import dirToObj from 'dir-contents-object';

(async () => {
  console.log(await dirToObj('./dir'));
})();

/**
  Prints:
  {
    a: {
      b: {
        'b.txt': '<file contents>',
      },
    },
    'a.txt': '<file contents>',
  }
*/

About

Convert the contents of a directory to an object

Resources

License

Stars

Watchers

Forks

Packages

No packages published