getscript-promise
v0.0.1
Published
Load and exectue a JavaScript file and return a promise. For use in client JavaScript code.
Downloads
291
Maintainers
Readme
getscript-promise
A Javascript Promise based library for fetching scripts asynchronously. To be used in client applications.
Using the Project
npm install getscript-promise
var getScript = require('getscript-promise')
GetScript
getScript returns a Promise
getScript(<script address>)
- returns a promise and appends script to document.
Example using await/async
await getScript('//www.googletagservices.com/tag/js/gpt.js')