0.0.4 • Published 9 years ago

jesuis v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

jesuis

git npm

Library for JSON parsing based on object matching. Outputs lineage trace as state progressed during search.

Example

Check out the example.js and test.js files for more examples.

var jesuis = require('jesuis');

var y = {
	a: 1,
	b: [1,2],
	c: [3,4,{b: true}]
}

jesuis.start(y, {b: true});

Reading Output

The outupt is written to ./tmp/jesuis.json file for accomodating drill-down analysis to identify the origin of the matched items. Lineage trace is stored per object in the json[idx].ancestors array, and that you may inspect for deciphering the origin of the JSON object the term was matched.

The example above would generate the following output:

[
    {
        "objectSearch": true,
        "node": {
            "b": true
        },
        "ancestors": [
            "root",
            {
                "a": 1,
                "b": [
                    1,
                    2
                ],
                "c": [
                    3,
                    4,
                    {
                        "b": true
                    }
                ]
            },
            [
                3,
                4,
                {
                    "b": true
                }
            ],
            {
                "b": true
            }
        ],
        "match": {
            "b": true
        }
    }
]

License

aug2uag © 2015, Licensed under MIT.

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago