0.2.0 • Published 2 years ago

make-types-rest v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

MTR

Convert JSON end-point to TypeScript Interface

npx make-types-rest

 Usage
    $ mtr --url <urlString>
    $ mtr --url <urlString> --copy
    $ mtr --url <urlString> --root post

  Options
    --url, -u   Url to be converted to Types
    --root, -r  Name of Interface default "RootObject"
    --copy, -c  Copy output to clipboard

  Examples
    $ mtr -u https://jsonplaceholder.typicode.com/posts  --root post

     interface Post {
       userId: number;
       id: number;
       title: string;
       body: string;
     }

Usage

Install

npm i -g make-types-rest

Run in command line

make-types-rest -u https://jsonplaceholder.typicode.com/posts --root post

or

mtr -u https://jsonplaceholder.typicode.com/posts -r post -c

Output

interface Post {
  userId: number
  id: number
  title: string
  body: string
}

Creds

json-to-ts - https://www.npmjs.com/package/json-to-ts

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago