postscribe-script
Asynchronously add script
tags with krux/postscribe.
Returns a Promise that is resolved after script executes.
Useful with browserify/webpack.
Usage
const postscribeScript = ; // add a `document.write(...)` ad script; // load jQuery dynamically; // something more realistic ;
Install
With npm do:
npm install postscribe-script
You will also need a Promise/A+ polyfill if you want to support older browsers. One of them is taylorhakes/promise-polyfill (recommended by github/fetch). Personally I like core-js, it has everything ES6 and more.