Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 502 Bytes

README.md

File metadata and controls

33 lines (26 loc) · 502 Bytes

smallest-script-loader

Smallest promise-based script loader with cache support

Installation

Yarn

yarn add smallest-script-loader

or NPM

npm i --save smallest-script-loader

Usage

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

Browser support

Only modern/evergreen browsers

License

MIT