Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

server-sent-events

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

server-sent-events

Express middleware to push events/messages from the server to the browser, using EventSource.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
215
increased by18.78%
Maintainers
1
Weekly downloads
 
Created
Source

server-sent-events

Express middleware to push events/messages from the server to the browser, using EventSource.

This middleware will keep the request stream open indefinitely, pad the initial response stream for IE and flush the response if the compression middleware is in use.

Detailed information on how to setup the browser/client can be found here.

Installation

$ npm install -g server-sent-events

Usage (with express)

// require sse
var sse = require('server-sent-events');
var express = require('express');

var app = express();

app.get('/events', sse, function(req, res) {
	// res.sse is made available via the middleware
	res.sse('data: im from the server\n\n');
});

Keywords

FAQs

Package last updated on 05 Jan 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc