0.1.1 • Published 8 years ago

superagent-case-converter v0.1.1

Weekly downloads
163
License
MIT
Repository
github
Last release
8 years ago

superagent-case-converter npm version Build Status codecov

Installation

$ npm i superagent-case-converter

Usage

When communicating to a REST endpoint that expects and sends out snake_case, caseConverter automatically transforms the payload from camelCase to snake_case case and the response from snake_case to camelCase.

Therefore the user has not to deal with snake_case.

import request from 'superagent'
import caseConverter from 'superagent-case-converter'

request
  .post(snakeCaseEndpoint)
  .send(payloadInCamelCase)
  .use(caseConverter)
  .end((err, res) => {
    const responseInCamelCase = res.body
  })
0.1.1

8 years ago

0.1.0

8 years ago

0.0.0

8 years ago