# jsoncpp

> json to cpp translator

Latest version **0.0.14** (published 2016-02-18) · GPL-2.0 license · 0 weekly downloads

## Install

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

Provides the command `jsoncpp`.

## 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.0.14 |
| Published | 2016-02-18 |
| First published | 2015-12-12 |
| Weekly downloads | 0 |
| License | GPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | mbusenitz@gmail.com |
| Maintainers | mucbuc |
| Keywords | json, c++, cpp, converter, translator |

## Links

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

## Dependencies (5)

- [tape](https://npm.io/package/tape.md) *
- [promise](https://npm.io/package/promise.md) *
- [expector](https://npm.io/package/expector.md) *
- [traverjs](https://npm.io/package/traverjs.md) *
- [mkdir-recursive](https://npm.io/package/mkdir-recursive.md) *

## 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.0.14 (latest) — 2016-02-18
- 0.0.13 — 2016-02-17
- 0.0.12 — 2016-01-25
- 0.0.11 — 2016-01-23
- 0.0.10 — 2016-01-22
- 0.0.9 — 2016-01-22
- 0.0.8 — 2016-01-15
- 0.0.7 — 2016-01-13
- 0.0.6 — 2015-12-24
- 0.0.5 — 2015-12-20
- 0.0.4 — 2015-12-20
- 0.0.3 — 2015-12-12
- 0.0.2 — 2015-12-12
- 0.0.1 — 2015-12-12

## README

##install
```
npm install -g jsoncpp
```

##usage
```
jsoncpp $input.json $output.h
```

##example input
```
{
    "wtf": { 
        "right": true,
        "zippo": null,
        "strings": [ "hello", "arrays" ]
    },
    "wrong": true, 
     "three": 3, 
     "arr": [ 3, false, "something" ],
     "single": "string",
     "nothing": null
}   
```

##example output

```
#ifndef TEST2_DATA_JSON_LW9O5SXX0LLERK9
#define TEST2_DATA_JSON_LW9O5SXX0LLERK9
namespace static_port_test2_data
{
template <class T = std::string, class U = int>
struct json
{
  typedef T string_type;
  typedef U number_type;
  std::nullptr_t _nothing;
  bool _wrong = true;
  number_type _three = 3;
  string_type _single = "string";
  struct wtf_type
  {
    std::nullptr_t _zippo;
    bool _right = true;
    std::tuple<string_type, string_type> _strings = {"hello", "arrays"};
    template<class V>
    void traverse(V & h)
    {
      h( "zippo", _zippo);
      h( "right", _right);
      h( "strings", _strings);
    }
  };
  wtf_type _wtf = {};
  std::tuple<number_type, bool, string_type> _arr = {3, false, "something"};
  template<class V>
  void traverse(V & h)
  {
    h( "nothing", _nothing);
    h( "wrong", _wrong);
    h( "three", _three);
    h( "single", _single);
    h( "wtf", _wtf);
    h( "arr", _arr);
  }
};
}
#endif
```

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