@lourd/load-script
v0.1.4
Published
Simple function for loading script tags in the browser asynchronously
Downloads
277
Maintainers
Readme
@lourd/load-script
This single-function JavaScript module is a simple, no-frills way to add script tags to a browser document asynchronously.
Installation
npm
yarn install @lourd/load-script
In the browser
Available as a simple <script>
through unpkg.com. The function will be available as the global variable loadScript
.
API
loadScript(url: String) : Promise<void>
Support
Bring your own Promise polyfill if you need to support browsers that do not have a native Promise implementation.
Does not support Internet Explorer.