config-export
v0.0.3
Published
Exporting modules of nodejs through index files
Downloads
1
Maintainers
Readme
config-export
Yet another NPM package for exporting all files inside the directory
Install
$ npm install --save config-export
Getting Started
Create index.js
file inside your directory, which you want to require
. e.g.
├── app
│ ├── controllers
│ │ └── index.js
│ ├── dao
│ │ └── index.js
│ ├── express-config.js
│ ├── index.js
│ ├── middleware
│ │ ├── index.js
│ │ ├── role.js
│ ├── routes.js
│ ├── util
│ │ ├── db.js
│ │ ├── index.js
│ └── views
│ └── help
inside every index.js
put following code
module.exports = require('configexport')(__dirname);
It finds all the files in the folder and adds them to the exports namespace.
If you need to excluded any file names it with _
e.g. you don't want to export private_config.js
, rename this with _
_private_config.js
Run Test
npm test
Contribute or Report Issue
For bugs and feature requests, please create an issue.
License
MIT © Yashprit