@dellarosamarco/json-2-ts
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

Installation

npm i --save @dellarosamarco/json-2-ts

Package.json

"devDependencies": {
    "@dellarosamarco/json-2-ts": "^1.1.4"
}

Usage

import { JsonReader } from "@dellarosamarco/json-2-ts";
import * as fs from "fs";

const data = {
    "id" : "640e2a4f3bb10c4d5924b377",
    "isActive" : true,
    "tags" : [
      {
        "id" : 1,
        "name" : "entertainment"
      },
      {
        "id" : 2,
        "name" : "simulation"
      }
    ],
    ...
}

const interfaces = JsonReader.convert(data);
// (string) → export interface ...

fs.writeFile("./types.d.ts", interfaces);

Readme

Keywords

Package Sidebar

Install

npm i @dellarosamarco/json-2-ts

Homepage

json2ts.app

Weekly Downloads

19

Version

1.1.7

License

ISC

Unpacked Size

11.6 kB

Total Files

26

Last publish

Collaborators

  • dellarosamarco