1.0.5 • Published 2 years ago

@3xpo/microjson v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

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.

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago