# koa-range

> range request implementation for koa

Latest version **0.3.0** (published 2017-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-range
pnpm add koa-range
yarn add koa-range
bun add koa-range
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2017-02-04 |
| First published | 2014-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/koa-range) |
| Module format | CommonJS |
| Node | >=7 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51 |
| Author | Yorkie Neil |
| Maintainers | yorkie |
| Keywords | range, koa, http |

## Links

- npm: https://www.npmjs.com/package/koa-range
- Repository: https://github.com/yorkie/koa-range
- Issues: https://github.com/yorkie/koa-range/issues
- npm.io page: https://npm.io/package/koa-range

## Dependencies (1)

- [stream-slice](https://npm.io/package/stream-slice.md) ^0.1.2

## Recent versions

- 0.3.0 (latest) — 2017-02-04
- 0.2.2 (release-0.2) — 2018-01-10
- 0.2.1 — 2016-04-03
- 0.2.0 — 2016-01-17
- 0.1.8 — 2014-09-16
- 0.1.7 — 2014-09-12
- 0.1.6 — 2014-09-11
- 0.1.5 — 2014-06-11
- 0.1.4 — 2014-06-11
- 0.1.3 — 2014-06-09
- 0.1.2 — 2014-06-08
- 0.1.1 — 2014-06-08
- 0.1.0 — 2014-06-08
- 0.0.1 — 2014-06-08

## README

koa-range
=================
range request implementation for koa

[![NPM version][npm-img]][npm-url]
[![Build status][travis-img]][travis-url]
[![Test coverage][coveralls-img]][coveralls-url]
[![License][license-img]][license-url]
[![Dependency status][david-img]][david-url]

[![NPM](https://nodei.co/npm/koa-range.png?stars&downloads)](https://nodei.co/npm/koa-range/)
[![NPM](https://nodei.co/npm-dl/koa-range.png)](https://nodei.co/npm/koa-range/)

### Installation

```sh
$ npm install koa-range
```

### Usage (with koa@2)

```js
var fs = require('fs');
var range = require('koa-range');
var route = require('koa-route');
var Koa = require('koa');
var app = new Koa();

app.use(range);

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

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

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

```

Until async/await is supported by default, you will need to do one of the following:
- Transpile your code with somehting like Babel
- Use node v7 with --harmony-async-await flag

### License

MIT

[npm-img]: https://img.shields.io/npm/v/koa-range.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-range
[travis-img]: https://img.shields.io/travis/koajs/koa-range.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/koa-range
[coveralls-img]: https://img.shields.io/coveralls/koajs/koa-range.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/koajs/koa-range?branch=master
[license-img]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square
[license-url]: https://opensource.org/licenses/MIT
[david-img]: https://img.shields.io/david/koajs/koa-range.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/koa-range

---
_Source: https://npm.io/package/koa-range · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
