node-export-dir
v1.0.2
Published
Export all javascript and json contents of a directory
Downloads
4
Readme
node-export-dir
Export contents of a given directory
Usage
Require the contents of a directory
// somedir/index.js
const exportDir = require(`node-export-dir`);
module.exports = exportDir();
// or…
module.exports = require(`node-export-dir`)();
Require the contents of another directory
If you wanted to do this for some reason.
// otherdir/index.js
// Using optional path
const exportDir = require(`node-export-dir`);
module.exports = exportDir(`${__dirname}/../somedir`);
Example Directory Structure
tree test
test
├── path0
│ ├── index.js
│ ├── p0file0.js
│ ├── p0file1.json
│ ├── p0file2.json
│ └── p0file3.js
├── path1
│ ├── index.js
│ ├── p1file0.js
│ ├── p1file1.txt
│ ├── p1file2.jpg
│ └── p1file3.md
└── path2
├── index.js
└── p2file0.js
Development
npm test