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

servie-send

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

servie-send

Generate a HTTP response with client-side cache support

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
Maintainers
1
Weekly downloads
 
Created
Source

Servie Send

NPM version NPM downloads Build status Test coverage

Create a HTTP response to send using Servie - a thin layer for creating a Response object with cache headers.

Installation

npm install servie-send --save

Usage

import { sendText, sendHtml, sendJson, sendStream, sendEmpty } from 'servie-send'

function handle (req) {
  return sendText(req, 'hello world!')
  return sendHtml(req, '<!doctype html>')
  return sendJson(req, { json: true })
  return sendStream(req, fs.createReadStream('example.txt'))
  return sendEmpty(req) // Nothing in response.
}

TypeScript

This project is written using TypeScript and publishes the definitions directly to NPM.

License

Apache 2.0

Keywords

FAQs

Package last updated on 14 Apr 2018

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