Socket
Book a DemoInstallSign in
Socket

http-sse

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-sse

Create server-sent-events

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

http-sse stability

npm version build status downloads js-standard-style

Create server-sent-events

Usage

var Sse = require('http-sse')
var http = require('http')

http.createServer(function (req, res) {
  var sse = Sse(req, res)
  sse.write('foo', 'bar')
  sse.write('bin', 'baz')
  sse.end('beep', 'boop')
})

API

sse = Sse(req, res)

Create a new SSE instance.

sse.write(name, data)

Write a new message to the SSE stream.

sse.end([name], [data])

Close the SSE stream.

See Also

License

MIT

Keywords

sse

FAQs

Package last updated on 19 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts