as-deepjson
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

as-deepjson

AssemblyScript module for getting values deep in JSON easily

Usage

import { DeepJsonParse } from "as-deepjson";

const json = `
{
    "animals": {
        "cats": [
            {
                "name": "Mittens",
                "age": 3
            }
        ]
    }
}

`.trim()

const parsed = new DeepJsonParse(json)
const value = parsed.get("animals.cats[0].name")

if(value != null){
    const name = value.toString()
    // name == "Mittens"
}

Package Sidebar

Install

npm i as-deepjson

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.85 kB

Total Files

3

Last publish

Collaborators

  • willoverton