fetch-script-async

1.0.0 • Public • Published

fetch-script-async

Async script fetcher with a promise API to help lazy load scripts.

Installation

npm install fetch-script-async
yarn add fetch-script-async

Example

import fetchScript from 'fetch-script-async';

const GA = 'https://www.google-analytics.com/analytics.js';

fetchScript(GA).then(script => {
  // do something after google analytics has been fetched and instantiated
});

Package Sidebar

Install

npm i fetch-script-async

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

62.9 kB

Total Files

23

Last publish

Collaborators

  • rileyhilliard