New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sw-send

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sw-send

Simple, dependency-free send middleware

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

sw-send

Simple, dependency-free send middleware

Install

npm install sw-send

Example

var send = require('sw-send');

// With express
app.use(send);

// or use it as you would any middlware
app.get('/example/page', send, function(req, res) {
	if(req.query.n) {
		res.send('NOT FOUND!', 404); // The status code can be passed in place of options
	} else {
		res.send('Some text', 'text/plain'); // and so can the Content-Type
	}
});

API

res.send(body, [options])

  • body - String or buffer holding the response body
  • options - Options object, optional
  • code - Status code, defaults to 200
  • type - Content-Type, defaults to text/html
  • charset - Character encoding, defaults to utf-8 for text/* MIME types, null otherwise

Keywords

middleware

FAQs

Package last updated on 06 Jul 2015

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