Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josepot/tsjson
JSON with better support for TS
https://github.com/josepot/tsjson
Last synced: 1 day ago
JSON representation
JSON with better support for TS
- Host: GitHub
- URL: https://github.com/josepot/tsjson
- Owner: josepot
- License: mit
- Created: 2020-02-26T17:55:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T08:23:35.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T06:09:11.828Z (7 months ago)
- Language: TypeScript
- Size: 1.53 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# typed-json
`JSON.stringify` and `JSON.parse` with better support for TS.
```ts
import { stringify, parse } from '@josepot/typed-json';interface Data {
foo: string;
bar: number;
}const data: Data = { foo: 'foo', bar: 10 };
const dataStr = stringify(data); // const dataStr: JsonString
const dataClone = parse(dataStr); // const dataClone: Data
```