# koa-spife

> Bastardize a [`@npm/spife`](http://github.com/npm/spife)-based application into [Koa](https://koajs.com/).

Latest version **0.1.1** (published 2019-12-02) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-12-02 |
| First published | 2019-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maciej Małecki |
| Maintainers | mmalecki |

## Links

- npm: https://www.npmjs.com/package/koa-spife
- Repository: https://github.com/mmalecki/koa-spife
- Homepage: https://github.com/mmalecki/koa-spife#readme
- Issues: https://github.com/mmalecki/koa-spife/issues
- npm.io page: https://npm.io/package/koa-spife

## Recent versions

- 0.1.1 (latest) — 2019-12-02
- 0.1.0 — 2019-07-28

## README

# koa-spife
Bastardize a [`@npm/spife`](http://github.com/npm/spife)-based application
into [Koa](https://koajs.com/).

## Important note
This module was written as a helper for transitioning from `@npm/spife` to Koa.
As such, it tries to do its best, but with the differences between the frameworks,
no promises can be made as to full compatibility.

Another caveat: this isn't really a wrapper for `spife`, as much as it's a
wrapper for [`reverse`](https://github.com/chrisdickinson/reverse). Why call it
`koa-spife`, then? `reverse` is non-prescriptive when it comes to the signature
of the route method - that's where `spife` comes in. It likes its functions'
signatures to look like this: `function (SpifeRequest, Map) -> Promise<Result>`.
`koa-spife` continues employing this signature to maintain compatibility, except
`SpifeRequest` is actually a `koa.Request`.

Wicked, right? Until I fix it, that is.

## Usage
Take the following `spife` constructor call:

```js
spife('pos-backend', http.createServer(), urls(), [
  require('@npm/spife/middleware/common')(),
  require('@npm/spife/middleware/body-json')(),
])
```

We can migrate this to Koa:

```js
const app = new Koa()
app.use(require('koa-bodyparser')())
app.use(require('koa-spife')(urls()))
```

## Why?
Something about [holes in feet](https://twitter.com/hashtag/npmlayoffs). Or me
being bored on vacation. Or `reverse` being, in my opinion, one of the most
elegant routers out there.

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