auto-js-loader
Ps. This module is based on "app-config" - https://www.npmjs.com/package/app-config
Loader utility for Node.js
to load different set of files in a folder based on working directory.
Use require('auto-js-loader')('DIRECTORY')
when "DIRECTORY" is the directory of the files you want to load.
NOTE: The file is loaded only once. If you want to load the file again, you will need to reload the application.
Quick intro to usage
Create the file
/app_root/commons/connection.js
Give the file some content
// Driver for MongoDBvar mongoose = ; // Connection propertiesmongoose; // MongoDB connectionvar db = mongooseconnection;db;db; moduleexports = mongoose;
Load the file in your app
var commons = 'commons';var mongoose = commonsconnection; console;
Run your app
node app.js
Installation
npm install auto-js-loader
Dependencies
The tool does not depend on any other code. For developers of this tool, Mocha
and Should
are the only dependencies for running unit tests.
Development
In order to develop this plugin, these steps are required:
- Clone the git repo by running
git clone URL
- Go to the newly created directory in Terminal
- Run
npm install
to download dependencies - Run unit tests by
npm test