Writes a script tag to the document if the document is loading or inserts a script tag in case the document finished loading.
npm i --save write-script
var writeScript = require('write-script');
writeScript('http://foo.com/bar.js', {
async: true
});
MIT