storm-load

1.0.4 • Public • Published

Storm load

npm version

Lightweight promise-based script loader for asynchronous and synchronous JS loading

Example

https://stormid.github.io/storm-load

Usage

JS

npm i -S storm-load

either using es6 import

import Load from 'storm-load;

//asynchronous script loading
Load('script-name.js')
    .then(() => {
        //use loaded JS
    });

//synchronous loading
Load(['script-1.js', 'script-that-depends-on-script-1.js'], false)
    .then(() => {
        //use loaded JS
    });

Tests

npm run test

Browser support

This is module has both es6 and es5 distributions. The es6 version should be used in a workflow that transpiles.

The es5 version depends upon Promises so all evergreen browsers are supported out of the box, ie9+ is supported with polyfills. ie8+ will work with even more polyfils for Array functions and eventListeners.

Dependencies

None

License

MIT

Package Sidebar

Install

npm i storm-load

Weekly Downloads

5

Version

1.0.4

License

MIT

Unpacked Size

10.3 kB

Total Files

7

Last publish

Collaborators

  • sarah-storm
  • mjbp
  • stormid-admin
  • lynchjames