This package provides lightweight dynamic resource loader for the web browsers.
- Node.js
>= 18.x
npm install dopant --save
import dopant from 'dopant';
dopant([
'//somewhe.re/assets/css/layout.css',
'//somewhe.re/assets/js/main.cjs',
]).then(() => console.log('pow!'));
dopant('//somewhe.re/assets/js/lib.js')
.then(() => dopant('//somewhe.re/assets/js/main.js'))
.finally(() => console.log('pow!'));
dopant('//somewhe.re/assets/js/index.mjs')
.then(() => console.log('pow!'));