# dolittlejs

> Dolittle kindly translates your camelCase JSON object keys into snake_case keys, and viceversa. It's meant to minimize the effort in translating camel case JSON keys of JS clients to snake case, used in some APIs made with Ruby, for example.

Latest version **0.1.5** (published 2016-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install dolittlejs
pnpm add dolittlejs
yarn add dolittlejs
bun add dolittlejs
```

## 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.5 |
| Published | 2016-01-25 |
| First published | 2015-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | castillobg |
| Maintainers | castillobg |
| Keywords | snake, camel, json, ruby, node |

## Links

- npm: https://www.npmjs.com/package/dolittlejs
- Repository: https://github.com/castillobg/dolittlejs
- Homepage: https://github.com/castillobg/dolittlejs#readme
- Issues: https://github.com/castillobg/dolittlejs/issues
- npm.io page: https://npm.io/package/dolittlejs

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.5 (latest) — 2016-01-25
- 0.1.4 — 2015-10-20
- 0.1.3 — 2015-08-04
- 0.1.2 — 2015-08-03
- 0.1.1 — 2015-08-02

## README

# dolittle.js
Dolittle kindly translates your camelCase JSON object keys into snake_case keys, and viceversa.
It's meant to minimize the effort in translating camel case JSON keys of JS
clients to snake case, used in some APIs made with Ruby, for example.

## Install it with npm or bower
```sh
$ bower install dolittlejs
```
```sh
$ npm install dolittlejs
```
### Angular module:
For the angular module, go [here](https://github.com/castillobg/dolittle).

## Use it
[Try it out on npm!](https://tonicdev.com/npm/dolittlejs)

```javascript
var dolittle = require('dolittlejs');

var testObj = {
  helloWorld : 'Hello World',
  nestedObject : {
    danger : 'Here be dragons',
    fooBar : [1, 2, 3],
    fooBarBaz : [
      { test1 : 'what'},
      { test2 : ['this', 'that']},
      nullioVonJulio : null
    ]
  }
};

var snakeized = dolittle.to.snake(testObj);
// will return:
// {
//   "hello_world" : "Hello World",
//   "nested_object" : {
//     "danger" : "Here be dragons",
//     "foo_bar" : [1,2,3],
//     "foo_bar_baz" : [
//       {"test1" : "what"},
//       {"test2" : [ "this","that"]},
//       "nullio_von_julio" : null
//     ]
//   }
// }

var camelized = dolittle.to.camel(snakeized);
// will return the original object.
```

## Thanks to
[painpony](https://github.com/painpony) for pointing out the zoo in this module, and [zubieta](https://github.com/Zubieta) for
the funny name.

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