npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

inject-lr-script-stream

1.1.1

@yoshuawuyts

npmHomeRepoSnykSocket
Downloads:940
$ npm install inject-lr-script-stream
DailyWeeklyMonthlyYearly

inject-lr-script-stream

NPM version build status Test coverage Downloads js-standard-style

Streamingly inject a livereload script into html.

Installation

$ npm install inject-lr-script-stream

Usage

const lr = require('inject-lr-script-stream')
const filed = require('filed')
const http = require('http')

http.createServer((req, res) => {
  filed(__dirname + '/index.html')
    .pipe(lr())
    .pipe(res)
})

API

lr(opts)

Create a duplex inject stream. Expects a <body> tag to be present. The following opts are available:

  • protocol: defaults to http
  • port: livereload port, defaults to 35729
  • host: livereload host, defaults to localhost

See Also

  • inject-lr-script
  • tiny-lr

License

MIT