load-external

1.0.2 • Public • Published

Easily load external js and css files (cross-browser).

var loadExternal = require('load-external');

loadExternal('https://js.stripe.com/v2/', function() {
    // alert('Stripe is loaded!');
});

loadExternal('https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css', function() {
    // alert('CSS Reset is loaded & applied!');
});

LoadExternal does its best to determine the type of file you wish to load, but you can also explicitly define the mode (currently accepts js or css):

loadExternal('https://js.stripe.com/v2/', 'js', function() {
    // alert('Stripe is loaded!');
});

/load-external/

    Package Sidebar

    Install

    npm i load-external

    Weekly Downloads

    86

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • remetric