{"_id":"@amida-tech/jsonave","_rev":"3-cad6450594e4a938a0e8c0a984606cce","name":"@amida-tech/jsonave","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.1":{"name":"@amida-tech/jsonave","version":"1.0.1","description":"A JSONPath implementation","main":"./index.js","directories":{"lib":"lib"},"scripts":{"test":"grunt test","verify":"grunt"},"author":{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},"license":"Apache-2.0","engines":{"node":">= 14.19.1"},"dependencies":{"lodash":"^4.17.21"},"devDependencies":{"grunt":"^1.5.2","grunt-contrib-jshint":"^3.2.0","grunt-contrib-watch":"^1.1.0","grunt-jsbeautifier":"^0.2.13","grunt-run":"^0.8.1","jest":"^27.5.1"},"repository":{"type":"git","url":"git+https://github.com/amida-tech/jsonave.git"},"keywords":["JSONPath","json-path"],"bugs":{"url":"https://github.com/amida-tech/jsonave/issues"},"homepage":"https://github.com/amida-tech/jsonave","gitHead":"fdd7cdef6f37f6d85743e9f29b4757fc6321d490","_id":"@amida-tech/jsonave@1.0.1","_nodeVersion":"16.14.2","_npmVersion":"8.8.0","dist":{"integrity":"sha512-jmL9vDDm1IzV5v0jz55rKKtWCnXoleo0q9Aqc3YTYTJiGBhfvphF6Qhc8TPKIaN8JyNSGCyneBvwKONjs00ioQ==","shasum":"4b16e837670fa491bbdde74fe944cf2b30369ef1","tarball":"https://registry.npmjs.org/@amida-tech/jsonave/-/jsonave-1.0.1.tgz","fileCount":32,"unpackedSize":113141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLZb0bbDtbN/+4lqumaW9HuZsGnPj+L4oZTHhh2DSrbwIhAO4Ssi76+YTTRA9+uA6241xKlUzgjwruFRV49LFEeaR1"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicxqcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqiXg/+LiXqYdkArygfPVEO0Ayr6U75zEXID3cFGBNIM69ay3UFbgWK\r\n/2vnXyW5BEdd3WlCOSM0PnKh0Dvqep5aJwngna+3ybfXHXc9QQxq+H9SdbSZ\r\nO5+JWCUd839rU5jQnckrW4ahDLsdhTn1uFgDSbNZcGuSfLoLoVoerk72TCeI\r\nJUGxX+kroGBKBMrrk3BwoPiDc4kX+ox3aYD30U+Qko3/W3Sm/eQB2CSVQbli\r\nDwFhK9hB1I56AeiVH163P7FA0R8kIZQAVPqIl5/VZifN4jjXFdP5+goS/YTP\r\nRuiB2HMXSpSzTfu0O93dK2UEWkFsaNCOsnYslfjGwTZUHZn9bHwZcE0qwNmm\r\nL+t+9z+Fi7W8yw0XQtZqb+Ly2AtP4yuOIwAj32LKICQr9KXWWKa66zUIWJ17\r\nYLaBkB1EFtxM97Hi2a7Rb1osJEYvEnOs2/N+RIF9g+Gq3vBb1Ew0qUAaF5Ad\r\n27/y3zL4n15CIN67DpeQYdJvjs9AXE2nyNUNSnCcBm1yt/NIr93HzAyts2TL\r\n7IBP709KuUUXPS41DjVg7xA4vN/LhZaPLn0Lmb9EEImDYAuxj3HiigHgh50z\r\ncLW+LcV0dJMUjw3OXlNQh3O8ggZTAc3J8v5PrLHGzC6IGBsvopTG5EeZGZ6o\r\na4wjSSOfXowvxpkk65aCzW7ikeuuM3rboCU=\r\n=2uAE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"manhydra","email":"marc.sylvestre@manhydra.com"},"maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsonave_1.0.1_1651710620041_0.6769199274303093"},"_hasShrinkwrap":false},"1.0.2":{"name":"@amida-tech/jsonave","version":"1.0.2","description":"A JSONPath implementation","main":"./index.js","directories":{"lib":"lib"},"scripts":{"test":"grunt test","verify":"grunt"},"author":{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},"license":"Apache-2.0","engines":{"node":">= 14.19.3"},"dependencies":{"lodash":"^4.17.21"},"devDependencies":{"grunt":"^1.5.2","grunt-contrib-jshint":"^3.2.0","grunt-contrib-watch":"^1.1.0","grunt-jsbeautifier":"^0.2.13","grunt-run":"^0.8.1","jest":"^27.5.1"},"repository":{"type":"git","url":"git+https://github.com/amida-tech/jsonave.git"},"keywords":["JSONPath","json-path"],"bugs":{"url":"https://github.com/amida-tech/jsonave/issues"},"homepage":"https://github.com/amida-tech/jsonave","gitHead":"4580148aef4c7ee06cb10b21d16714d86a5c7ef8","_id":"@amida-tech/jsonave@1.0.2","_nodeVersion":"16.14.2","_npmVersion":"8.10.0","dist":{"integrity":"sha512-c24E/FMBTB9YXK7JVpOV2Pmtti6PMCpQ5Y/2uI8aUrS5KafQ2JPGCP+RaGIsLAL2KBuT1jw5SK/MtbuXnRl28w==","shasum":"6308f51719163e5fbf7f4f1b242db7986c5fb2f4","tarball":"https://registry.npmjs.org/@amida-tech/jsonave/-/jsonave-1.0.2.tgz","fileCount":32,"unpackedSize":113230,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDI3EjzYQzqwKg3kfeUYSlbBWGcZlEqyR4xEOwCeZT+UAiBMlylzhGcSeIrOMBmpKdkYZt3a6bQCkQBQsVUXcFIOsQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilnGEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrlnhAAnnJtfa7GgnM5HUmku5Ya8fkzG4Xid7jPunhlWDnGgZD0e19q\r\nONTdaSBeEbym0cL//veLq/W7n+g6ilYOdQtEt/0BplwK6wwaZ8ihJhRQ74Xa\r\newe7C/JlHNqs4KChcEOtICd9wG2PR5Wb9ahyKx1ScstZS/bH7XT3p1s8VVFQ\r\nSNiiDcKApQYLmGrCxb683xg8ae+pwnH7GAoUKZCvfgOvJ2yfJrNPX7ZOjYCA\r\nB2BwkDI5q7ENpCj85+RdneP6seBc8Z3qdKfWG5Wjwzarpj7C9fMNUkw/dDU9\r\nIE8QLFff5RlpGsMZE1T4MyMarvj0HKM8I+c5uyfJNs3KWijkFkOyY7FrLAU6\r\nbGx9U4KxZgIynS1yhkMVGkmx1tmeIAhYYO/97VeQ3bo1CXiTG1PQvk6jkq31\r\nNBRTG3INjc+CSSSUsBB4n3aiG6THJGa+DGtzdrvGFZgZp1zenCu9Ik88X1UG\r\nkEoAIb/7cpSSYJrB6LcPi/CHADfUMQnTsNS0pBBP/8g47Eo8nOoILJ/23ZTZ\r\nmPaPGA/3I8HaSvQAosfduHBFcvgwf4JwZHWU6YSdukgWzsLCwlQNMQ81LC4A\r\niZGynE65lfQAy19kdlCzgcSdI92/StY7ITdmqxDjy2q7dpnlK4JK8/GgmPJp\r\nGFIfh9SlKPUDH37O4K+Rf4mfUVH4WayLFx4=\r\n=wloG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"manhydra","email":"marc.sylvestre@manhydra.com"},"maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsonave_1.0.2_1654026628239_0.7558479899535235"},"_hasShrinkwrap":false},"1.0.3":{"name":"@amida-tech/jsonave","version":"1.0.3","description":"A JSONPath implementation","main":"./index.js","directories":{"lib":"lib"},"scripts":{"test":"grunt test","verify":"grunt"},"author":{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},"license":"Apache-2.0","engines":{"node":">= 14.19.3"},"dependencies":{"lodash":"^4.17.21"},"devDependencies":{"grunt":"^1.5.3","grunt-contrib-jshint":"^3.2.0","grunt-contrib-watch":"^1.1.0","grunt-jsbeautifier":"^0.2.13","grunt-run":"^0.8.1","jest":"^27.5.1"},"repository":{"type":"git","url":"git+https://github.com/amida-tech/jsonave.git"},"keywords":["JSONPath","json-path"],"bugs":{"url":"https://github.com/amida-tech/jsonave/issues"},"homepage":"https://github.com/amida-tech/jsonave","gitHead":"66361004ceaba05fda16fe310ddc38ad43994e94","_id":"@amida-tech/jsonave@1.0.3","_nodeVersion":"16.14.2","_npmVersion":"8.12.1","dist":{"integrity":"sha512-mgyumuBObL7fx+78AwXXpy3cCvWgyHGqpkZ3U0VF6ixvxnmtyPPzi/UXWT3JkxJTBksP80mvJILGPD1Lu7IQjA==","shasum":"90d4bb878fda5b9651ab3d97f8576c1c7e2ae02c","tarball":"https://registry.npmjs.org/@amida-tech/jsonave/-/jsonave-1.0.3.tgz","fileCount":32,"unpackedSize":112947,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbcbrJDD8OmrokfF/S7P5RaIeoKwW7W2uUgOWfEzu9YAiB+H32gZ0i4TlacoVUhy78W3bf3jIJt+XSEPdtUgQyECg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6ZO4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwtQ/8DROGVfL89mVo/JuweQeMpBzZHIRdHsp6WkoKztjW7zLkU9hC\r\nU5RIkmrxLZFPXx5WXIxFDTssv40wOmUhBgxOfexlHzIpxQLECCVJEm4HUwgt\r\nW4ocZq+W9UBNuuNQ7NzyWKaATNvv6NQ1asMAQy7PD+zQ7w3vAtTikU+hPmzc\r\nZekmuKlwdW90j6u0DrjGKTzXW7UQBwgtRprYFqif6IFG+pE2R/0tTb0RuoYb\r\nZhRS2pci+uFa4Em/q2cAxqKpk4X3Gk7z1t4bVU5B8tYmUP3w/wwoF8ODncjU\r\nnNyGq1bOT1ryHfs4ZS03zrxhUAWuxya4oxmD1n9q/A4qu5BjBiymq+LFOxXg\r\ngnIeHgkb3gq+sS46hHjYgspY4q+YvgJ2OCaNeRFPSxzWoEx36x1cPV7DDL9w\r\nxZtyPPPbzpPzYlRv7LiBhoUehPZl2lqpft42nDNWW9k9Oeyj4yP1OvtAoRSc\r\nT0hgNS4Syu0MWCQZP9fI6LLaBYhRVibuU8eNBQyi8xKD1LX8+rBaSShlPLNq\r\naZ7/qt2z0yDWZvvsAKksKH/YkkZNTGY8r/vqJovJuWTAwfarLHqoxWEDo1M/\r\neZSo4Jh9Cgwp9K27ym7HYayAwuQdBEdXHKlTij2s3XSgQ+QUQV0H3VvXzOrS\r\nhBXTa3GAupOAKQJabX3ITkGg0dE3kVcjikc=\r\n=Ic1Y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"manhydra","email":"marc.sylvestre@manhydra.com"},"maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsonave_1.0.3_1659474872719_0.8795828055361417"},"_hasShrinkwrap":false},"1.0.4":{"name":"@amida-tech/jsonave","version":"1.0.4","description":"A JSONPath implementation","main":"./index.js","directories":{"lib":"lib"},"scripts":{"test":"grunt test","coverage":"grunt coverage","verify":"grunt"},"author":{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},"license":"Apache-2.0","engines":{"node":">= 14.19.3"},"dependencies":{"lodash":"^4.17.21"},"devDependencies":{"grunt":"^1.6.1","grunt-contrib-jshint":"^3.2.0","grunt-contrib-watch":"^1.1.0","grunt-jsbeautifier":"^0.2.13","grunt-run":"^0.8.1","jest":"^29.7.0"},"repository":{"type":"git","url":"git+https://github.com/amida-tech/jsonave.git"},"keywords":["JSONPath","json-path"],"bugs":{"url":"https://github.com/amida-tech/jsonave/issues"},"homepage":"https://github.com/amida-tech/jsonave","_id":"@amida-tech/jsonave@1.0.4","gitHead":"a78cdd9afedff0ccf987b6d0a1e347661c3fabb6","_nodeVersion":"18.19.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-FhMRx9SfDXbrh3GdQASSQTVKJ6R766+gupgYV/gT2uW81jW4n2hQfc+DcYuaoVaf0SAk71BOvhgh0zEU6QEslw==","shasum":"598fb69e2ca3a4421ce66dc8c4d10b1d76cc652b","tarball":"https://registry.npmjs.org/@amida-tech/jsonave/-/jsonave-1.0.4.tgz","fileCount":33,"unpackedSize":113419,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzTGxDq24f8S9fie8WrabHoioejsK4E2xCRv5KBzhDlwIhAMEpfFQnlieCdlR3A7dEdrB3GyJje50KS2JmuvGse6Q6"}]},"_npmUser":{"name":"manhydra","email":"marc.sylvestre@manhydra.com"},"maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jsonave_1.0.4_1712344267208_0.8910751993156565"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-05T00:30:19.971Z","1.0.1":"2022-05-05T00:30:20.232Z","modified":"2024-04-05T19:11:07.561Z","1.0.2":"2022-05-31T19:50:28.375Z","1.0.3":"2022-08-02T21:14:32.898Z","1.0.4":"2024-04-05T19:11:07.367Z"},"maintainers":[{"name":"manhydra","email":"marc.sylvestre@manhydra.com"}],"description":"A JSONPath implementation","homepage":"https://github.com/amida-tech/jsonave","keywords":["JSONPath","json-path"],"repository":{"type":"git","url":"git+https://github.com/amida-tech/jsonave.git"},"author":{"name":"Afsin Ustundag","email":"afsin.ustundag@us.pwc.com"},"bugs":{"url":"https://github.com/amida-tech/jsonave/issues"},"license":"Apache-2.0","readme":"# jsonave\nA JSONPath Implementation\n\n[![NPM](https://nodei.co/npm/@amida-tech/jsonave.png)](https://nodei.co/npm/@amida-tech/jsonave/)\n\n[![Build Status](https://travis-ci.org/amida-tech/jsonave.svg)](https://travis-ci.org/amida-tech/jsonave)\n[![Coverage Status](https://coveralls.io/repos/amida-tech/jsonave/badge.png)](https://coveralls.io/r/amida-tech/jsonave)\n\nThis library provides an implementation of [JSONPath](http://goessner.net/articles/JsonPath).  Originally it was based on [this implementation](https://github.com/s3u/JSONPath) and added support for functions.  Current version however is a complete rewrite and code is structured so that no performance penalties are paid when parent and path functionalities are not used.  [Original API and options](https://github.com/s3u/JSONPath) are still supported.\n\nAnother implementation of JSONPath is [jsonpath](https://github.com/dchester/jsonpath).  [jsonpath](https://github.com/dchester/jsonpath) does not include the additional functionality to the original [JSONPath](http://goessner.net/articles/JsonPath) such as functions and parent that this library provides.  However it does use a fully defined BNF parser based on [Jison](https://github.com/zaach/jison). This library uses a manually implemented parser.  No performance comparison to [jsonpath](https://github.com/dchester/jsonpath) has been made either for the parsers or the actual [JSONPath](http://goessner.net/articles/JsonPath) engine.\n\nIn addition to functionality described [here](https://github.com/s3u/JSONPath), this library implements ability to add functions as part of JSONPath.  The example below illustrates the additional functionality.  Some options functionality are also modified as follows\n- ***wrap*** - Whether or not to wrap the results in an array. If `wrap` is set to true, the result will always be an array which can be empty.  If `wrap` is set to false, and no results are found, `null` will be returned (as opposed to an empty array). If `wrap` is set to false and a single result is found, that result will be the only item returned. If `wrap` is not specified, it is set to `true` if branching elements (`..`, `*`, `:` (range), `,` (multiple properties)) are used and it will be set to `false` otherwise. An array will still be returned if multiple results are found, however.\n- ***emptyValue*** - This specifies what to return if no results are found.  If `wrap` is specified this defaults to `[]` and if it is not specified it defaults to `null`.\n\n## Quick up and running guide\n\n### Prerequisites\n\n- Node.js (v14.19+) and NPM\n- Grunt.js\n\n```\n# Install dependencies\nnpm i\n\n# Install grunt\nnpm i -g grunt\n\n# Test\ngrunt\n\n```\n\n## Usage\n\n### <a name=\"instance\"></a>instance(inputExpr, opts) ###\n\nReturns a JSONPath evaluator.  You can define functions for JSONPath expressions in `opts.sandbox`\n\n```js\nvar example = {\n    \"store\": {\n        \"book\": [{\n            \"category\": \"reference\",\n            \"author\": \"Nigel Rees\",\n            \"title\": \"Sayings of the Century\",\n            \"price\": 8.95\n        }, {\n            \"category\": \"fiction\",\n            \"author\": \"Evelyn Waugh\",\n            \"title\": \"Sword of Honour\",\n            \"price\": 12.99\n        }, {\n            \"category\": \"fiction\",\n            \"author\": \"Herman Melville\",\n            \"title\": \"Moby Dick\",\n            \"isbn\": \"0-553-21311-3\",\n            \"price\": 8.99\n        }, {\n            \"category\": \"fiction\",\n            \"author\": \"J. R. R. Tolkien\",\n            \"title\": \"The Lord of the Rings\",\n            \"isbn\": \"0-395-19395-8\",\n            \"price\": 22.99\n        }],\n        \"bicycle\": {\n            \"color\": \"red\",\n            \"price\": 19.95\n        }\n    }\n};\n\nvar options = {\n    sandbox: {\n        round: function (obj) {\n            return Math.round(obj);\n        }\n    }\n};\n\nvar jp = jsonave.instance('$.store..price.round()', options);\nvar result = jp(example);\nconsole.log(result); // [ 9, 13, 9, 23, 20 ]\n```\n\nIt is also possible to define functions during the evaluation call\n```js\n\nvar round = function (obj) {\n    return Math.round(obj);\n};\n\nvar jp = jsonave.instance('$.store..price.round()');\nvar result = jp(example, {\n    round: round\n});\nconsole.log(result); // [ 9, 13, 9, 23, 20 ]\n```\n\n## License\n\nLicensed under [Apache 2.0](./LICENSE).\n","readmeFilename":"README.md"}