superjson
superjson copied to clipboard
Koa/Express Middleware
This middleware will allow for SuperJSON to be used as part of an API server. Intial plan is to support Koa and Express.
Proposed Usage
import Koa from 'koa'
import bodyParser from 'koa-bodyparser'
import { koaSuperJSON } from '@onedeadpixel/superjson-middleware'
const app = new Koa()
app.use(bodyParser())
app.use(koaSuperJSON())
// ctx.request.body will now be parsed by SuperJSON
// ctx.response.body will now be stringified by SuperJSON