{"id":18429452,"url":"https://github.com/bigpipe/propget","last_synced_at":"2025-04-07T17:33:04.915Z","repository":{"id":66257336,"uuid":"37852760","full_name":"bigpipe/propget","owner":"bigpipe","description":"Use dot notation to get properties from deeply nested object and array structures.","archived":false,"fork":false,"pushed_at":"2017-01-02T16:43:29.000Z","size":4,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-15T07:50:00.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigpipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-22T11:57:27.000Z","updated_at":"2024-06-18T22:47:32.009Z","dependencies_parsed_at":"2023-02-24T10:01:00.211Z","dependency_job_id":null,"html_url":"https://github.com/bigpipe/propget","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"194bfa11d43f2850c7d7a18ba4b1fada7377d793"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpropget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpropget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpropget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fpropget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigpipe","download_url":"https://codeload.github.com/bigpipe/propget/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247697992,"owners_count":20981284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T05:17:14.051Z","updated_at":"2025-04-07T17:33:04.621Z","avatar_url":"https://github.com/bigpipe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# propget\n\nPropget is a small helper utility for finding values/keys in deeply nested\nobjects without having to worry about undefined properties and what not. It uses\na human readable dot based notation to find items in your object or array.\n\n## Installation\n\nJust install it through npm, like you do with the all your code:\n\n```\nnpm install --save propget\n```\n\nIt doesn't use any fancy node.js magic or ES6 so it should be good to go for\nbrowser usage as well using something as browserify.\n\n## Usage\n\nUsing the module is super simple. We export the `propget` method as default\nfunction:\n\n```js\nvar propget = require('propget');\n```\n\nThe function accepts the following arguments:\n\n- `object`, data structure that we need to walk.\n- `string`, dot notated string for deeply nested object access.\n- `..`, rest arguments that will be used for optional function calls.\n\nSo accessing a complex data structure can be as easy as this:\n\n```js\n'use strict';\n\nvar prop = require('propget')\n  , data = { hello: 'world', yo: { deeply: ['nested', 'arrays'] } };\n\nprop(data, 'hello'); // world\nprop(data, 'yo.deeply.1'); // arrays\nprop(data, 'yo.deeply.nested.unknown.keys'); // undefined\n```\n\n#### Function execution\n\nOf one the unique functions of this module is that it allows you to execute\nfunctions that are inside data structure. We can then re-use the result of the\nfunction and walk it further.\n\n```js\ndata = { \n  hello: { \n    world: function () { \n      return { \n        hi: 'hello'\n      };\n    }\n  }\n};\n\nprop(data, 'hello.world().hi') // hello\n```\n\nBut in addition to simple function execution we can also call these functions\nwith arguments. We automatically use the additionally supplied arguments to the\npropget method for this.\n\n```js\ndata = { \n  hello: { \n    world: function (arg) { \n      return { \n        hi: arg\n      };\n    }\n  }\n};\n\nprop(data, 'hello.world(what).hi', 'additional') // additional\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2Fpropget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigpipe%2Fpropget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2Fpropget/lists"}