Smallest promise-based script loader with cache support
Yarn
yarn add smallest-script-loader
or NPM
npm i --save smallest-script-loader
import loadScript from 'smallest-script-loader';
loadScript('//www.somewebsite.com/some-script.js')
.then(() => {
// do something after loading the script
})
.catch(e => {
console.error(e);
});
Only modern/evergreen browsers
MIT