import { JSONParser, JSONSerializer } from '@3xpo/microjson';
// parser:
const parser = new JSONParser();
console.log(parser.parse<{
hello: string; // this object is optional, however it allows specifying detailed types for the return value without casting
}>('{"hello": "world"}'));
// serializer:
const serializer = new JSONSerializer();
console.log(serializer.serialize({ hello: 'world' }));
import JSON from '@3xpo/microjson/polyfill';
console.log(JSON.parse<{
hello: string; // yet again, this object is optional, however it allows specifying detailed types for the return value without casting
}>('{"hello": "world"}'));
console.log(JSON.stringify({ hello: 'world' }, null, 2));
Thanks goes to these wonderful people (emoji key):
ExponentialWorkload 💻 📖 🚇 🚧 ⚠️ |
This project follows the all-contributors specification. Contributions of any kind welcome!
Tests & JSDoc were written using ChatGPT because I'm lazy.
This project is licensed under the MIT license. See LICENSE for more information.
Generated using TypeDoc