Storm Load

Asynchronously loads d3, then uses it to renders this chart:

Synchronously loads d3 and d3 charts (that depends on d3), then uses it to renders this diagram chart:


Installation

$ npm i -S storm-load

Usage

Import and initialise using a named import:

import Load from 'storm-load;

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