Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
feat: add readme (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT authored Sep 30, 2023
1 parent 393cb71 commit b4e5ed6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
9 changes: 3 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@


# 0.2.0 (2023-09-30)


### Features

* add `createTupleson` fn and more ([#2](https://github.com/KATT/tupleson/issues/2)) ([72910ae](https://github.com/KATT/tupleson/commit/72910ae35c55581b860207e8e45ac098f5bef6ad))
* initial version ([#1](https://github.com/KATT/tupleson/issues/1)) ([ccce25b](https://github.com/KATT/tupleson/commit/ccce25b6a039cf2e5c1a774c1ab022f0946ca8d5))
* initialized repo ✨ ([c9e92a4](https://github.com/KATT/tupleson/commit/c9e92a42c97a8bc1ee3a9214f65626425c8598e3))
- add `createTupleson` fn and more ([#2](https://github.com/KATT/tupleson/issues/2)) ([72910ae](https://github.com/KATT/tupleson/commit/72910ae35c55581b860207e8e45ac098f5bef6ad))
- initial version ([#1](https://github.com/KATT/tupleson/issues/1)) ([ccce25b](https://github.com/KATT/tupleson/commit/ccce25b6a039cf2e5c1a774c1ab022f0946ca8d5))
- initialized repo ✨ ([c9e92a4](https://github.com/KATT/tupleson/commit/c9e92a42c97a8bc1ee3a9214f65626425c8598e3))
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,31 @@

## Introduction

Not much to see yet, but you can spy on the tests.
A hackable JSON serializer/deserializer that allows you to serialize/deserialize almost[^1] anything.

### Example

```ts
const json = createTupleson({
// This nonce function is used to generate a nonce for the serialized value
// This is used to identify the value as a serialized value
nonce: () => "__tson",
types: [tsonSet],
});

const result = json.stringify(
{
foo: "bar",
set: new Set([1, 2, 3]),
},
2,
);
console.log(result);
```

**Footnotes**:

[^1]: We don't support circular references as we don't think it's very desireable, but if you wanna contribute with adding opt-in support for that, you are very welcome!

## Contributors

Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export {
tsonSerializer,
tsonStringifier,
} from "./tson.js";

export * from "./handlers/index.js";

0 comments on commit b4e5ed6

Please sign in to comment.