https://github.com/kossnocorp/json-bond
Type-safe JSON strings
https://github.com/kossnocorp/json-bond
Last synced: 15 days ago
JSON representation
Type-safe JSON strings
- Host: GitHub
- URL: https://github.com/kossnocorp/json-bond
- Owner: kossnocorp
- Created: 2020-05-31T11:09:26.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T07:30:31.000Z (over 2 years ago)
- Last Synced: 2025-03-29T01:34:49.497Z (about 1 month ago)
- Language: TypeScript
- Size: 1.07 MB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# JSON bond
JSON bond provides a way to add type-safety to JSON strings.
## Installation
The library is available as an [npm package](https://www.npmjs.com/package/json-bond). To install JSON bond, run:
```sh
npm install json-bond --save
# Or using Yarn:
yarn add json-bond
```## Usage
```ts
import { JSONBond, parse, stringify } from 'json-bond'type Abc = { [char: string]: number }
const abc: Abc = { a: 1, b: 2 }const json = stringify(abc)
//=> JSONBondconst result = parse(json)
//=> Abc
```## Changelog
See [the changelog](./CHANGELOG.md).
## License
[MIT © Sasha Koss](https://kossnocorp.mit-license.org/)