@3xpo/microjson

Social Card

MicroJSON

Build & Deploy Tests
documentation npm github
mit license mom made pizza mom made pizza
All Contributors

A JSON implementation quickly thrown together.

Example

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' }));

As a polyfill

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));

Contributors ​

Thanks goes to these wonderful people (emoji key):

ExponentialWorkload
ExponentialWorkload

💻 📖 🚇 🚧 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

Tests & JSDoc were written using ChatGPT because I'm lazy.

License

This project is licensed under the MIT license. See LICENSE for more information.

Generated using TypeDoc