cross-module
v0.0.1
Published
This package can help you transform invasive modules into non-invasive, with cross-platform support.
Downloads
4
Readme
cross-module
This package can help you transform invasive modules into non-invasive, with cross-platform support.
Installation
npm install --save-dev cross-module
Why
There are too many intrusive SDKs I need to import.
For example, most of APM (application performance management) agents are invasive. You have to import apm
in the first line of code.
// invasive code
require('apm')
// your code
console.log('cross-module')
Is there a way to remove the invasive importation?
// your code
console.log('cross-module')
Usage
Just add cross-mod ${moduleName/modulePath}
to npm scripts.
{
"start": "cross-mod apm cross-env NODE_ENV=production node index.js"
}
If you need custom features,add ${moduleConfigFileName}.js
to your directory.
require('apm')({
// options
})