JSPM

html-inject-script

1.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 3607
    • Score
      100M100P100Q124555F
    • License ISC

    Package Exports

    • html-inject-script

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (html-inject-script) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    html-inject-script

    Transform stream for injecting script tags into html.

    example:

    var injectScripts = require('html-inject-script')
    
    process.stdin
    .pipe( injectScripts(['./app.js', './extra.js']) )
    .pipe( process.stdout )

    input:

    <html><head></head><body>hello</body></html>

    output:

    <html><head><script src="./app.js"></script><script src="./extra.js"></script></head><body>hello</body></html>

    cli

    cat index.html | htmlinjectscript "app.js" > output.html

    Gotcha:

    requires a head tag to be present in the src.