dir-contents-object
v2.0.0
Published
Convert the contents of a directory to an object
Downloads
9
Readme
dir-contents-object
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>',
}
*/