# @web3api/serial-as-json

> JSON Serializer for Assemblyscript

Latest version **1.1.2** (published 2022-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @web3api/serial-as-json
pnpm add @web3api/serial-as-json
yarn add @web3api/serial-as-json
bun add @web3api/serial-as-json
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-05-30 |
| First published | 2022-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Guillermo Gallardo and Willem Wyndham |
| Maintainers | dorgjelli, web3-api-build-bot |

## Links

- npm: https://www.npmjs.com/package/@web3api/serial-as-json
- Repository: https://github.com/gagdiez/serial-as
- npm.io page: https://npm.io/package/@web3api/serial-as-json

## Dependencies (6)

- [as-base64](https://npm.io/package/as-base64.md) 0.2.0
- [as-bigint](https://npm.io/package/as-bigint.md) 0.5.3
- [as-bignumber](https://npm.io/package/as-bignumber.md) 0.2.0
- [as-container](https://npm.io/package/as-container.md) 0.6.1
- [@web3api/serial-as-core](https://npm.io/package/@web3api/serial-as-core.md) 1.1.2
- [@web3api/assemblyscript-json](https://npm.io/package/@web3api/assemblyscript-json.md) 1.2.0

## Recent versions

- 1.1.2 (latest) — 2022-05-30
- 1.0.4 — 2022-05-10
- 1.0.3 — 2022-05-10

## README

# JSON-as

**json-as** is an assemblyscript implementation of the [JSON](https://json.org) 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.

```ts
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)  
```

---
_Source: https://npm.io/package/@web3api/serial-as-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
