0.2.0 • Published 3 years ago
node-dir-to-obj v0.2.0
node-dir-to-obj
Convert the contents of a directory to an object.
Installation
npm i node-dir-to-objUsage
Suppose a directory structure like this:
a.txt
subDir
-- b.txtimport dirToObj from 'node-dir-to-obj';
const obj = await dirToObj('<dir path>');
/*
{
'a.txt': '<contents of a.txt>',
sub: {
'b.txt': '<contents of a.txt>',
},
}
*/Options
ignoreMapa set of names that should be ignored.textModedumps file contents as text instead of hex.