https://github.com/linck/jsontyped
Json to Typescript object converter
https://github.com/linck/jsontyped
json typescript
Last synced: about 1 month ago
JSON representation
Json to Typescript object converter
- Host: GitHub
- URL: https://github.com/linck/jsontyped
- Owner: linck
- Created: 2016-09-24T17:18:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T16:46:20.000Z (about 9 years ago)
- Last Synced: 2025-09-23T22:55:55.427Z (9 months ago)
- Topics: json, typescript
- Language: TypeScript
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jsontyped
[](https://nodei.co/npm/protontype/)
Load Json file in Typescript Object
## How to use
**Simple!**
**1. Create your json file:**
*myconfig.json*
{
"port": "3000",
"databaseName": "teste"
}
**2. Define your type:**
export interface MyConfig {
port: number;
databaseName: String;
}
**3. Load your json file and use:**
import { JsonLoader } from "jsontyped";
var config: MyConfig = JsonLoader.loadFile("./myconfig.json");
connect(config.port, config.databaseName);