load-script-global
Advanced tools
Weekly downloads
Readme
Load a global library via a script tag
$ npm install --save load-script-global
var load = require('load-script-global')
load({
url: 'https://maps.googleapis.com/maps/api/js?key=k',
global: 'google',
jsonp: true
}, function (err, google) {
//=> google.Maps...
})
<script>
tag but still call the callback with the libraryload(options, callback)
-> undefined
Required
Type: object
Required
Type: string
The script URL.
Required
Type: string
The name of the window global that the script will publish.
Type: boolean
If true
, listens for success via a JSONP callback instead of on script.onload
.
Required
Type: function
Arguments: err, library
A callback that will be called with a loading error or the library as published on the window once available.
MIT © Ben Drucker
FAQs
Load a global library via a script tag
The npm package load-script-global receives a total of 765 weekly downloads. As such, load-script-global popularity was classified as not popular.
We found that load-script-global demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.