dopant
v4.0.6
Published
The aerogel-weight & dead-simple resource loader π
Downloads
14
Readme
The aerogel-weight & dead-simple resource loader π
This package provides lightweight dynamic resource loader for the web browsers.
Prerequisites
- Node.js
>= 18.x
Installation
npm install dopant --save
Usage
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!'));