Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```