0.0.0 • Published 10 years ago

script-injector-sync v0.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

script-injector-sync Flattr this!experimental

Inject JavaScript into HTML, synchronously – intended as an alternative to script-injector.

Usage

script-injector-sync

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.