{"_id":"jsondom","_rev":"19-53ee60735339fad1297419bac91136b8","name":"jsondom","description":"A DOM-like interface for querying Javascript Objects","dist-tags":{"latest":"0.4.1"},"versions":{"0.0.1":{"name":"jsondom","version":"0.0.1","description":"A DOM-like interface for querying Javascript Objects","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha test/index.js","lint":"./node_modules/.bin/jshint **/*js"},"repository":{"type":"git","url":"https://www.github.com/CondeNast/jsondom"},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"author":{"name":"Todd Kennedy"},"license":"MIT","dependencies":{"traverse":"~0.6.3"},"devDependencies":{"mocha":"~1.12.1","chai":"~1.7.2","jshint":"~2.1.10"},"_id":"jsondom@0.0.1","dist":{"shasum":"77c87ca731fee7d3dc72d05d069550e16c08171c","tarball":"https://registry.npmjs.org/jsondom/-/jsondom-0.0.1.tgz","integrity":"sha512-clUk2z7ELM3OLmhq+dqfYoAjhh2vCYAeHB3dVgQhbaBIhgN2RFMKCLaO9SJ3LlTWgCARCKyUjHJi3BEMnuDGHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz4AQfP9kJIrEFyTqfoIYDSt8QIgBCD0aCuH9ErjT4zgIhAMEz2LSXNxD+cg2I9hdTzHJlukcW+en7+VmuzHkCufXY"}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"toddself","email":"todd.kennedy@gmail.com"},"maintainers":[{"name":"toddself","email":"todd.kennedy@gmail.com"}]},"0.1.0":{"name":"jsondom","version":"0.1.0","description":"A DOM-like interface for querying Javascript Objects","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha test/index.js","lint":"./node_modules/.bin/jshint **/*js"},"repository":{"type":"git","url":"https://www.github.com/CondeNast/jsondom"},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"author":{"name":"Todd Kennedy"},"license":"MIT","dependencies":{"traverse":"~0.6.3"},"devDependencies":{"mocha":"~1.12.1","chai":"~1.7.2","jshint":"~2.1.10"},"_id":"jsondom@0.1.0","dist":{"shasum":"b8896437d15823632a3f7d77a500adcd79233455","tarball":"https://registry.npmjs.org/jsondom/-/jsondom-0.1.0.tgz","integrity":"sha512-oMIkGEcLSXqAl/pMJWdFe4oT86D6I+xaMPhA2hYSLKwnBKImM523nj/SwoQ2a1SvHCk8j4zfa056bcVp9ZI/Ag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCthul6bqSlWEv7mOKTk0OWcL1aktyc+l9jGekzIih3ywIgLUxt9KhrsYO8ONcfZp6aYeb1gXuJHtZ7MpCAyo4vQcE="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"toddself","email":"todd.kennedy@gmail.com"},"maintainers":[{"name":"toddself","email":"todd.kennedy@gmail.com"}]},"0.2.0":{"name":"jsondom","version":"0.2.0","description":"A DOM-like interface for querying Javascript Objects","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha test/index.js","lint":"./node_modules/.bin/jshint **/*js"},"repository":{"type":"git","url":"https://www.github.com/CondeNast/jsondom"},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"author":{"name":"Todd Kennedy"},"license":"MIT","dependencies":{"traverse":"~0.6.3"},"devDependencies":{"mocha":"~1.12.1","chai":"~1.7.2","jshint":"~2.1.10"},"_id":"jsondom@0.2.0","dist":{"shasum":"040716289cbb854898cef132c0259292b0672c6c","tarball":"https://registry.npmjs.org/jsondom/-/jsondom-0.2.0.tgz","integrity":"sha512-lMCowTkU8f1KWM5OXcekoqG3UwKG4HKsG6N+tKaaFu/Z9XCKkZDW+RJsJmf7yakYgm59r4eGzh9C+FZInvjYUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5nOeVXp7jsJFejN1kMU7eCCDwiqtgsVBeD2G3csydhgIgN9b0iQf1XCffYk566XkIIL0TJ9beXpgX140/chq/JyU="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"toddself","email":"todd.kennedy@gmail.com"},"maintainers":[{"name":"toddself","email":"todd.kennedy@gmail.com"}]},"0.3.0":{"name":"jsondom","version":"0.3.0","description":"A DOM-like interface for querying Javascript Objects","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha test/index.js","lint":"./node_modules/.bin/jshint **/*js"},"repository":{"type":"git","url":"https://www.github.com/CondeNast/jsondom"},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"author":{"name":"Todd Kennedy"},"license":"MIT","dependencies":{"traverse":"~0.6.3"},"devDependencies":{"mocha":"~1.12.1","chai":"~1.7.2","jshint":"~2.1.10"},"_id":"jsondom@0.3.0","dist":{"shasum":"14f1b0c4581091216436e38826b968e3d0b7014a","tarball":"https://registry.npmjs.org/jsondom/-/jsondom-0.3.0.tgz","integrity":"sha512-pbySGK5ATajoLcUFKIC63pRPL8wjzCL9oj6++CmXFTX4VreW4rVrFXoITkEpKk1pm1pZ0MC15RdFaohgh8Uigg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvOBBX1fTIyz+7l7RXTbTeH3z9fbb9TpPsj1t5lsj1ugIgS0UOIGXHTTXDO4Xdc9SMiHzBsXL41io37OH0ytfKW2E="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"toddself","email":"todd.kennedy@gmail.com"},"maintainers":[{"name":"toddself","email":"todd.kennedy@gmail.com"}]},"0.3.1":{"name":"jsondom","version":"0.3.1","description":"A DOM-like interface for querying Javascript Objects","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha test/index.js","lint":"./node_modules/.bin/jshint **/*js"},"repository":{"type":"git","url":"https://www.github.com/CondeNast/jsondom"},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"author":{"name":"Todd Kennedy"},"license":"MIT","dependencies":{"traverse":"~0.6.3"},"devDependencies":{"mocha":"~1.12.1","chai":"~1.7.2","jshint":"~2.1.10"},"_id":"jsondom@0.3.1","dist":{"shasum":"0d948dfb6334078e354f2b5ae1c1dd5e27b332b9","tarball":"https://registry.npmjs.org/jsondom/-/jsondom-0.3.1.tgz","integrity":"sha512-GvEkL/dfuqTx0t5ZmnarE+3sGRWvZwz8wVlGUoLPE4Qc3DQdHtcTVFkMK51vAXq9gmJh0bTJu7Wx+qf9w1tDmQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkj7fTS8+PvY76Zzs3Z2+sQgAaDVwXnKG/NiRnAdx9mQIgb5zbunEvyfVmdSw9ZCbHE6GW3e5PrWGtrPn3rEQffjs="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"toddself","email":"todd.kennedy@gmail.com"},"maintainers":[{"name":"toddself","email":"todd.kennedy@gmail.com"}]},"0.4.0":{"name":"jsondom","version":"0.4.0","description":"A DOM-like interface for querying Javascript Objects","main":"index.js","scripts":{"test":"./node_modules/.bin/mocha test/index.js","lint":"./node_modules/.bin/jshint **/*js"},"repository":{"type":"git","url":"https://www.github.com/CondeNast/jsondom"},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"author":{"name":"Todd Kennedy"},"license":"MIT","dependencies":{"traverse":"~0.6.3"},"devDependencies":{"mocha":"~1.12.1","chai":"~1.7.2","jshint":"~2.1.10"},"_id":"jsondom@0.4.0","dist":{"shasum":"edeaff4838c3c75f7cb4b7b01ff6422bc7936f2d","tarball":"https://registry.npmjs.org/jsondom/-/jsondom-0.4.0.tgz","integrity":"sha512-opOPd9EML4kPqDmciVEtsCX3mAX/19n81WxJToilyp+6VMs3BG9gfeSrzXMNWmEQmZGMvGdPcvBEz5hxSXJxfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+ZPmIFlS9y+LksPpJS6I8CvfyrBogm/c5GNxTVSFBrgIga8no/q+9frubKIJL+QgsxTOGoDmojDM2bRXQOwHx4+E="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"toddself","email":"todd.kennedy@gmail.com"},"maintainers":[{"name":"toddself","email":"todd.kennedy@gmail.com"}]},"0.4.1":{"name":"jsondom","version":"0.4.1","description":"A DOM-like interface for querying Javascript Objects","main":"index.js","scripts":{"test":"mocha test/index.js","lint":"jshint **/*js"},"repository":{"type":"git","url":"https://www.github.com/toddself/jsondom"},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"author":{"name":"Todd Kennedy","email":"todd@selfassembled.org"},"license":"MIT","dependencies":{"traverse":"~0.6.3"},"devDependencies":{"mocha":"~1.12.1","chai":"~1.7.2","jshint":"~2.1.10"},"_id":"jsondom@0.4.1","_shasum":"d767aed7be08eddc4745ef5720d6fe300a5eb4eb","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"toddself","email":"todd@selfassembled.org"},"maintainers":[{"name":"toddself","email":"todd.kennedy@gmail.com"}],"dist":{"shasum":"d767aed7be08eddc4745ef5720d6fe300a5eb4eb","tarball":"https://registry.npmjs.org/jsondom/-/jsondom-0.4.1.tgz","integrity":"sha512-7RomNwQjU3GrOalyXr69FaS4d7Mor5/tfo0pATizFllV3AX02du4rxTIV1ZS7XvN4B7ynMjqkH6qqZt/qlCZ+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAD6RVCmfZPVT9EN6QoWBlcf4wP4eCb5nqS8uY4+6yyFAiEA4lQgDtx4LpolsmSMXS24d5VQilvlwIO4/zDcu5gkm34="}]}}},"readme":"[![build status](https://secure.travis-ci.org/toddself/jsondom.png)](http://travis-ci.org/CondeNast/jsondom)\n\n# JSON DOM\nA DOM-like interface for querying complex Javascript objects. (Also a very light wrapper around [js-traverse](/substack/js-traverse)).\n\n## Installation\n\n```\nnpm install jsondom\n```\n\n## Usage\n\n```js\n> var jsd = require('jsondom');\n> var complex = {\n  title: \"this is a test\",\n  articles: [\n    {\n      title: \"sub title\",\n      articles: \"this is an article\"\n    },\n    {\n      hello: \"it is me you're looking for\"\n    }\n  ]\n};\n\n> jsd.getValuesByKeyName(complex, 'title');\n[\"this is a test\", \"sub title\"]\n\n> jsd.getValuesByKeyName(complex, 'title', 1);\n[\"this is a test\"]\n\n> jsd.getNodesMatching(complex, 'articles');\n[\n  [\n    {\n      title: 'sub title',\n      articles: 'this is an article'\n    },\n    {\n      hello: 'it is me you\\'re looking for'\n    }\n  ],\n  'this is an article'\n]\n\n> js.getNodesMatching(complex, 'articles', true);\n[ { title: 'this is a test',\n    articles: [ [Object], [Object] ] },\n  { title: 'sub title',\n    articles: 'this is an article' } ]\n```\n\n## Methods\n\n### `getValuesFromPartialPath(tree, key)`\n\n```\n/**\n * Gets an array of values from a path which ends with the given path fragment.\n * This method optionally takes an array to generate the path end data from\n * @param  {Object} tree Object graph\n * @param  {Mixed}  key  String or Array\n * @return {Array}       Array of values matching partial path\n */\n```\n\n### `valueFromPath(tree, key_array, getParent)`\n\n```\n/**\n * Takes an array of nodes to the content location and returns the value located\n * at that point. Can we used to return the parent node as well.\n * @param  {Object}   tree        Object graph\n * @param  {Array}    key_array   An array of keys, traversable from the left\n * @param  {Boolean}  (getParent) Flag to return parent or element. Default: element\n * @return {Mixed}                The content located at that point in the tree\n */\n```\n\n### `getPathToKey(tree, key)`\n\n```\n/**\n * Gets the path to a particular key in the Object\n * @param  {Object} tree Object graph\n * @param  {Mixed}  key  String or RegExp\n * @return {Array}       Array of decimal separated paths to object suitable to\n *                       use with valueFromKeyPath\n */\n```\n\n### `getNodesMatching(tree, needle, parent)`\n\n```\n/**\n * Returns a node of the tree if any of the keys or values in the node match the\n * provided criteria\n * @param  {Object}   tree      Object graph\n * @param  {Mixed}    needle    A string or RegExp describing what to find\n * @param  {Boolean}  (parents) Should it return the parent of the matching element\n * @return {Array}              An array of parent nodes which have matching children\n */\n};\n```\n\n### `getValuesByKey(tree, key, maxDepth)`\n\n```\n/**\n * Gets all values from object graph that exist at the specified key name\n * @param  {Object}   tree       Object graph\n * @param  {Mixed}    key        A RegExp or string for the key you're trying to find\n * @param  {Integer}  (maxDepth) Max recursion depth\n * @return {Array}               Array of values from matching keys\n */\n```\n\n## License\nCopyright 2013 Condé Nast. Licensed under the MIT License.","maintainers":[{"email":"todd@selfassembled.org","name":"toddself"}],"time":{"modified":"2022-06-19T06:37:03.692Z","created":"2013-08-30T20:09:34.040Z","0.0.1":"2013-08-30T20:09:35.720Z","0.1.0":"2013-08-30T20:11:49.752Z","0.2.0":"2013-09-01T13:54:20.482Z","0.3.0":"2013-10-03T17:33:54.563Z","0.3.1":"2013-10-03T17:45:24.496Z","0.4.0":"2013-10-12T16:15:11.189Z","0.4.1":"2014-05-15T16:51:11.372Z"},"author":{"name":"Todd Kennedy","email":"todd@selfassembled.org"},"repository":{"type":"git","url":"https://www.github.com/toddself/jsondom"},"users":{"alexyan":true},"keywords":["json","dom","traverse","search","sort","filter","map","reduce"],"license":"MIT","readmeFilename":"README.md"}