anytv-node-importer

Require all files in directory

Usage no npm install needed!

<script type="module">
  import anytvNodeImporter from 'https://cdn.skypack.dev/anytv-node-importer';
</script>

README

anytv-node-importer

Build Status Coverage Status Documentation Dependencies npm version

Require files in a folder and turn them into an object. Especially made for our awesome expressjs boilerplate.

Install

npm install anytv-node-importer --save

Usage

Importing all files in a folder

import importer from 'anytv-node-importer';

const imports = importer.dirloadSync('./controllers');

Documentation

Code documentation can be found at here.

Contributing

Install the tools needed:

npm install babel -g
npm install esdoc -g
npm install mocha -g
npm install --dev

To compile the ES6 source code to ES5:

npm run compile

To generate the docs:

npm run docs

Running test

npm test

Code coverage

npm run coverage

Then open coverage/lcov-report/index.html.

License

MIT

Author

Freedom! Labs, any.TV Limited DBA Freedom!