0.0.0-pre0 • Published 5 years ago

importeer v0.0.0-pre0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
5 years ago

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})