promised-script-loader
v1.0.1
Published
A modern day promise based script loader with built in caching
Downloads
16,580
Maintainers
Readme
Promised-Script-Loader
A Promise based script loader with in built caching. Supports both async and defer loading.
To Install
npm i Promised-script-loader
To Use
import scriptLoader from '@script-loader'
scriptLoader([ an array of all the scripts to load ], options = { how to load it })
.then(() => {
console.log('script has been loaded')
})
.catch(err => console.log(err))
this will return a promise
Load Options
options : {
"async": boolean,
"defer": boolean
}
Author
Saurabh khandelwal (https://github.com/saurabhkhandelwal)
License
MIT License