script-injector-sync
Inject JavaScript into HTML, synchronously – intended as an alternative to script-injector.
Usage
html = inject(html, script)
Returns a modified version of html
with script
inlined. The script will
either be inserted before the first script on the page, or if there are none
available it will be inserted before the <body>
's closing tag.
script
is just arbitrary JavaScript – anything you would otherwise put in a
file or inline manually.
License
MIT. See LICENSE.md for details.