importeer
v0.0.0-pre0
Published
Import Dynamic Modules at runtime if needed so that they can Unload if not needed
Maintainers
Readme
Importeer
A CJS dynamic Import for NodeJS Only at present (if you are not a user of requrejs at last)
Why?
Because i wanted to code like i would use Import but using only require
- Dynamic CJS module loading inside NodeJS with Modules that get garbage collected after execution
Usage
example async await
const load = require('importeer')
async function test(dependencys) {
const [ http, child_process] = await dependencys;
const { exec } = child_process;
console.log(exec);
// After that log all is removed from ram!!!!!
}
test(Importeer(['http', 'child_process']));
example promise
const load = require('importeer)
function test(dependencys) {
const [ http, child_process] = dependencys;
const { exec } = child_process;
console.log(exec);
// After that log all is removed from ram!!!!!
}
Importeer(['http', 'child_process']).then(test})