@serial-as/json
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

JSON-as

json-as is an assemblyscript implementation of the JSON serializer.

How to use it

Install the package via yarn add @serial-as/json and add the --transform @serial-as/transform flag to your asc command.

import { stringify, parse } from '@serial-as/json'

@serializable
class Pair{
  x: i32 = 0,
  y: i32 = 0
}

let pair:Pair = {x:1, y:2}

// `serialized` is the string "{"x":1,"y":2}"
let serialized: string = stringify(object)  

// `decoded` is the Pair = {x:1, y:2}
let decoded: Pair = parse<Pair>(serialized)  

Readme

Keywords

none

Package Sidebar

Install

npm i @serial-as/json

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

19.7 kB

Total Files

10

Last publish

Collaborators

  • gagdiez