Package Exports
- enquire
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (enquire) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
enquire
an environment based replacement for node.js requireInstallation
$ npm install enquirewhy
enquires task is simple; wrap the node.js require module to provide environment based modularisation.
this module should be useful for the following scenarios
- abstract away some io bound resource in order to simplify a dev or test environment
- environment configuration that requires code executionUsage
Example 1; with module request, default NODE_ENV
given the following module structure
/some_module/
index.js
/some_module-development/
index.jswhen we request some_module with default NODE_ENV
var module = enquire('some_module');then return some_module
module = some_moduleExample 2; with module request, development NODE_ENV
given the following module structure
/some_module/
index.js
/some_module-development/
index.jswhen we request some_module with NODE_ENV set to "development"
process.env.NODE_ENV = "development";
var module = enquire('some_module');then return some_module-development
module = some_module-developmentExample 3; with module request, environment parameter override
given the following module structure
/some_module/
index.js
/some_module-development/
index.jswhen we request some_module overriding environment parameter as "development"
var module = enquire('../test/doubles', "development");then return some_module-development
module = some_module-development