New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

koa-transform

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-transform

Transform request parameters style

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

koa-transform

Build Status Coverage Status

Transform request parameters style

Useage

const Koa = require('koa');
const transform = require('koa-transform');

const app = new Koa();
app.use(transform());

app.use(async ctx => {
  // the `ctx.query` and `ctx.request.body` 
  // will be transformed to camel style
  // when request /?post_id=1
  ctx.query; // -> { postId: 1 }

  // the data set to `ctx.body`
  // will be transformed to snake style
  ctx.body = { userId: 1 } // -> { user_id: 1 }
});

Keywords

koa

FAQs

Package last updated on 14 Mar 2017

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