https://github.com/krtools/json-tell
Generates TypeScript interfaces from a JSON object
https://github.com/krtools/json-tell
json node typescript
Last synced: 2 months ago
JSON representation
Generates TypeScript interfaces from a JSON object
- Host: GitHub
- URL: https://github.com/krtools/json-tell
- Owner: krtools
- License: mit
- Created: 2020-05-26T01:58:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T19:01:56.000Z (over 4 years ago)
- Last Synced: 2025-10-20T21:51:49.495Z (9 months ago)
- Topics: json, node, typescript
- Language: TypeScript
- Size: 336 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-tell [](https://travis-ci.com/krtools/json-tell) [](https://packagephobia.now.sh/result?p=json-tell)
Generates TypeScript interfaces from a JSON object
- Node 10+
- Zero Dependencies
#### Installation
```
npm install json-tell
```
```
yarn add json-tell
```
#### Usage
```tsx
import {getTypes} from 'json-tell';
const options = {
exported: false,
root: 'RootObject'
};
const json = getJsonFromSomewhere();
console.log(getTypes(json, options));
```
#### Options
- `exported`: If true, will add `export` to all interfaces
- `root`: Specify the name of the root object interface (defaults to `'RootObject'`)