Socket
Socket
Sign inDemoInstall

koa-range

Package Overview
Dependencies
1
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    koa-range

range request implementation for koa


Version published
Weekly downloads
191K
decreased by-9.05%
Maintainers
1
Install size
10.7 kB
Created
Weekly downloads
 

Readme

Source

koa-range Build Status

range request implementation for koa

NPM NPM

Installation

$ npm install koa-range

Usage

var fs = require('fs');
var range = require('koa-range');
var route = require('koa-route');
var koa = require('koa');
var app = koa();

app.use(range);

// via buffer
app.use(route.get('/', function * () {
  this.body = new Buffer(100);
}));

// via object
app.use(route.get('/json', function * () {
  this.body = {
    'foo': 'bar'
  };
}));

// via readable stream
app.use(route.get('/stream', function * () {
  this.body = fs.createReadStream('your path');
}));

License

MIT

Keywords

FAQs

Last updated on 11 Jun 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc