fetch-script-async
v1.0.0
Published
async script fetcher to help lazy load scripts after a document has loaded
Maintainers
Readme
fetch-script-async
Async script fetcher with a promise API to help lazy load scripts.
Installation
npm install fetch-script-asyncyarn add fetch-script-asyncExample
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
});