script-injector-sync

0.0.0 • Public • Published

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.

/script-injector-sync/

    Package Sidebar

    Install

    npm i script-injector-sync

    Weekly Downloads

    2

    Version

    0.0.0

    License

    MIT

    Last publish

    Collaborators

    • hughsk