@3xpo/microjson
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @3xpo/microjson

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

835 kB

Total Files

27

Last publish

Collaborators

  • exponentialworkload