@dqn/json-type
v0.2.0
Published
[![CI](https://github.com/dqn/json-type/workflows/CI/badge.svg)](https://github.com/dqn/json-type/actions) [![npm version](https://img.shields.io/npm/v/@dqn/json-type.svg)](https://www.npmjs.com/package/@dqn/json-type)
Downloads
2
Readme
json-type
Generate type from JSON string.
Installation
Using npm:
$ npm install @dqn/json-type
Using yarn:
$ yarn add @dqn/json-type
Example
import type { JsonType } from "@dqn/json-type";
type Obj = JsonType<'{ "foo": "aaa", "bar": 12, "piyo": { "nyaa": [null, true] } }'>;
// type Obj = {
// foo: "aaa";
// bar: 12;
// piyo: {
// nyaa: [null, true];
// };
// };
License
MIT