{"id":19560644,"url":"https://github.com/zoubin/getp","last_synced_at":"2025-10-07T06:37:59.481Z","repository":{"id":57250653,"uuid":"41894222","full_name":"zoubin/getp","owner":"zoubin","description":"Get nested properties","archived":false,"fork":false,"pushed_at":"2015-10-07T16:52:40.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T05:17:04.873Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-04T02:34:47.000Z","updated_at":"2015-09-04T03:49:21.000Z","dependencies_parsed_at":"2022-08-24T16:51:58.636Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/getp","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgetp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgetp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgetp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgetp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/getp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240822615,"owners_count":19863302,"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-11T05:08:22.586Z","updated_at":"2025-10-07T06:37:54.434Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getp\nGet nested properties.\nSupport dots and array descriptions.\n\n## Example\n\n```javascript\nvar getp = require('getp');\n\n```\n\n```\no                expr                             value\n---------------  -------------------------------  ---------\no.u = 1          getp(o, 'u')                     1\no.v = null       getp(o, 'v')                     null\no.z = undefined  getp(o, 'z')                     undefined\no.w.x = 1        getp(o, 'w', 'x')                1\no.w.x = 1        getp(o, ['w', 'x'])              1\no.w.x = 1        getp(o, 'w.x')                   1\no.v = null       getp(o, 'v.x')                   undefined\no.x.y.z.u.v = 1  getp(o, 'x', ['y', 'z'], 'u.v')  1\no[\"a.b\"] = 1     getp(o, 'a.b')                   undefined\no[\"a.b\"] = 1     getp(o, 'a.b', false)            1\n```\n\n### getp(obj, name1, name2,..., [parseDots = true])\n\n#### obj\n\nType: `Anything`\n\nThe host object of the property being accessed.\n\n#### name\n\nType: `String`, `Number`, `Array`\n\nIf `Array`, it is expanded as an array of strings.\n\nIf `String`, it will be parsed as part of the path to reach the property.\n\n#### parseDots\n\nType: `Boolean`\n\nDefault: `true`\n\nIf `false`, name strings will be treated literaly.\n\n\n### set(o, ...names, v)\n\n```javascript\nvar set = require('getp/set')\nvar o = {}\nset(o, 'x', 'y', 1)\nconsole.log(o)\n// { x: { y: 1 } }\n\nvar o = {}\nset(o, ['x', 'y'], 1)\nconsole.log(o)\n// { x: { y: 1 } }\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fgetp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fgetp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fgetp/lists"}