dyimp

dynamic import for node.js

Usage no npm install needed!

<script type="module">
  import dyimp from 'https://cdn.skypack.dev/dyimp';
</script>

README

dyimp.js

ey ey ey! this is just another simple lib that might be help your life easier & more fun!

So, I dont like importing file like this

const moduleA = require('../../modules/moduleA');
// or
const moduleB = require('../../../../utils/modules/moduleB');

how if we could always importing file start from root dir huh?

const dyimp = require('dyimp');
const moduleA = dyimp('modules/moduleA');
const moduleB = dyimp('utils/modules/moduleB');

ok, just it!