Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 783 Bytes

quick-start.md

File metadata and controls

60 lines (39 loc) · 783 Bytes

Quick Start Guide

Installation

NPM

$ npm i jsonat --save

CDN

<script src="https://cdn.jsdelivr.net/npm/jsonat"></script>

or

<script src="https://unpkg.com/jsonat"></script>

Importing

JSONAT

import { JSONAT } from "jsonat";

JSONATS

import { JSONATS } from "jsonat";

Stringify

let value = {
  function: () => console.info("Can stringify function."),
  set: new Set([1])
}

let text = await JSONAT.stringify(value);

Parse

let value = await JSONAT.parse('{"name":"JSONAT"}');

Fetch

let value = await JSONAT.fetch("https://api.genderize.io?name=john");

Parse Partial

let value = await JSONAT.parsePartial({
  primaryColor: "${Uint8ClampedArray([240, 219, 79])}"
});