3.1.2 • Published 6 years ago

load.js v3.1.2

Weekly downloads
112
License
MIT
Repository
github
Last release
6 years ago

Load.js

Dynamically loading external JavaScript and CSS files

Install

npm install load.js

How use?

const load = require('load');

/* you could use jquery functions here */
await load.js('jquery.js');

/* load menu css and then do some magic */
await load.css('menu.css');

/* recognition file type by extension */
const [e, event] = await tryToCatch(load, 'css-or-.js');

const [e, footer] = await tryToCatch(load, 'template/footer.html');

const [e, config] = await tryToCatch(load.json, 'config.json');

const [e, header] = await tryToCatch(load.ajax, 'template/header.html');

/* load one-by-one */
await load.series([
    'jquery.js',
    'jq-console.js',
]);

/* load all together and call callback */
await load.parallel([
    'menu.css',
    'menu.js',
]);

License

MIT

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.5

8 years ago

1.1.4

9 years ago

0.1.1

11 years ago

0.1.0

11 years ago