https://github.com/lourd/js-load-script
Small, no-frills JavaScript module for loading script tags in the browser asynchronously
https://github.com/lourd/js-load-script
browser javascript loader promise small-modules
Last synced: 10 months ago
JSON representation
Small, no-frills JavaScript module for loading script tags in the browser asynchronously
- Host: GitHub
- URL: https://github.com/lourd/js-load-script
- Owner: lourd
- License: mit
- Created: 2018-01-28T01:19:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-21T06:33:29.000Z (about 7 years ago)
- Last Synced: 2025-08-04T15:29:58.789Z (11 months ago)
- Topics: browser, javascript, loader, promise, small-modules
- Language: JavaScript
- Size: 107 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @lourd/load-script [![npm package badge][npm-badge]][npm] [![Build status][travis-badge]][travis]
[npm-badge]: https://img.shields.io/npm/v/@lourd/load-script.svg?style=flat-square
[npm]: https://www.npmjs.com/package/@lourd/load-script
[travis-badge]: https://travis-ci.org/lourd/js-load-script.svg
[travis]: https://travis-ci.org/lourd/js-load-script
This single-function JavaScript module is a simple, no-frills way to add script tags to a browser document asynchronously.
## Installation
### npm
```sh
yarn install @lourd/load-script
```
### In the browser
[Available as a simple `` through unpkg.com](https://unpkg.com/@lourd/load-script). 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.