Skip to content

Small, no-frills JavaScript module for loading script tags in the browser asynchronously

License

Notifications You must be signed in to change notification settings

lourd/js-load-script

Repository files navigation

@lourd/load-script npm package badge Build status

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.

About

Small, no-frills JavaScript module for loading script tags in the browser asynchronously

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published