lourd / js-load-script

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@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

License:MIT License


Languages

Language:JavaScript 54.2%Language:TypeScript 45.8%