1.0.2 • Published 4 years ago

async-scripts-loader v1.0.2

Weekly downloads
315
License
MIT
Repository
github
Last release
4 years ago

async-scripts-loader

NPM Version License: MIT NPM Downloads

async-scripts-loader package loads bunch of js files in async way and handles when all the given files are loaded with onload and onerror states for each given script. Package is bundled as UMD and compatible with browser and npm. It returns a Promise from Promise.all(). async-scripts-loader is extra tiny (less then 1.5 KB) and does not have external dependencies!

Examples

Browser

<script src="https://unpkg.com/async-scripts-loader"></script>
<script>
loadScriptAsync(['https://code.jquery.com/jquery-3.4.1.min.js', 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js']).then(() => {
  console.log("Scripts are loaded");
});
</script>

NPM

const loadScriptAsync = require("async-scripts-loader");

Source Code

loadScriptAsync()

Contribution Notes

Clone project on github

Install libraries

npm i

Build & Test

npm test

Open Pull Request

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago