https://github.com/maximilianmairinger/circjson
Json (readable) inspired serializer for cyclic objects.
https://github.com/maximilianmairinger/circjson
circ circular json object recursive serializer
Last synced: 2 months ago
JSON representation
Json (readable) inspired serializer for cyclic objects.
- Host: GitHub
- URL: https://github.com/maximilianmairinger/circjson
- Owner: maximilianMairinger
- Created: 2023-02-24T23:26:47.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-05T12:56:14.000Z (almost 2 years ago)
- Last Synced: 2025-01-22T08:42:45.064Z (4 months ago)
- Topics: circ, circular, json, object, recursive, serializer
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/circ-json
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Circ json
Json (readable) inspired serializer for cyclic objects.
## Installation
```shell
$ npm i circ-json
```## Usage
Analog to `JSON`
```ts
import { stringify, parse } from "circ-json"const c = {
a: 1,
b: {i: 1}
}c.c = c
c.bb = c.bconst s = stringify(c) //{"a":1,"b":{"i":1},"c":{"$ref":"#"},"bb":{"$ref":"#/b"}}
deepEqual(parse(s), c) // true
```## Contribute
All feedback is appreciated. Create a pull request or write an issue.