{"id":19340777,"url":"https://github.com/0xvoidmain/deep-obj","last_synced_at":"2026-05-14T08:33:32.574Z","repository":{"id":82546158,"uuid":"75375321","full_name":"0xvoidmain/deep-obj","owner":"0xvoidmain","description":"Set and get values on objects via dot-notation strings","archived":false,"fork":false,"pushed_at":"2016-12-30T10:46:03.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-17T08:29:12.842Z","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/0xvoidmain.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-02T08:15:15.000Z","updated_at":"2020-06-09T23:33:55.000Z","dependencies_parsed_at":"2023-03-08T14:30:30.429Z","dependency_job_id":null,"html_url":"https://github.com/0xvoidmain/deep-obj","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"0a375f32e8050b7cb6ff1000cc03f99649894f0b"},"previous_names":["0xvoidmain/deep-obj","tunght91/deep-obj"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/0xvoidmain/deep-obj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvoidmain%2Fdeep-obj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvoidmain%2Fdeep-obj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvoidmain%2Fdeep-obj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvoidmain%2Fdeep-obj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xvoidmain","download_url":"https://codeload.github.com/0xvoidmain/deep-obj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xvoidmain%2Fdeep-obj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33017006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10T03:27:51.490Z","updated_at":"2026-05-14T08:33:32.559Z","avatar_url":"https://github.com/0xvoidmain.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeepObject\n\nSet and get values on objects via dot-notation strings.\n\n## Example\n\n```js\nvar DeepObject = require('deep-obj');\nvar get = DeepObject.get;\nvar set = DeepObject.set;\n\nvar testObject = {\n\ta: {\n\t\tb: {\n\t\t\tc: [{\n\t\t\t\tae: 1\n\t\t\t}, {\n\t\t\t\tae2: ['demoo']\n\t\t\t}]\n\t\t},\n\t\td: [1,2,3]\n\t},\n\t'test-abc': {\n\t\ta: {\n\t\t\tb: [[1, 2, 3], [4, 5, 6]]\n\t\t}\n\t},\n\t'abc\"de\"': 1,\n\t'[abc\"de\"]': 3\n}\n\nconsole.log(get(testObject, ''), testObject);\n\nconsole.log(get(testObject), testObject);\n\nconsole.log(get(testObject, 'a.b.c'), testObject.a.b.c);\n\nconsole.log(get(testObject, '[\"a.b\"]'), testObject['a.b']);\n\nconsole.log(get(testObject, '[\\'abc\"de\"\\']'), testObject['abc\"de\"']);\n\nconsole.log(get(testObject, '[\\'[abc\"de\"]\\']'), testObject['[abc\"de\"]']);\n\nconsole.log(get(testObject, 'a.d[0]'), testObject.a.d[0]);\n\nconsole.log(get(testObject, 'a.b.c[0]'), testObject.a.b.c[0]);\n\nconsole.log(get(testObject, ['a', 'd', 0]), testObject.a.d[0]);\n\nconsole.log(get(testObject, 'a.b.c[0][\"ae\"]'), testObject.a.b.c[0][\"ae\"]);\n\nconsole.log(get(testObject, 'a.b.c[0].ae'), testObject.a.b.c[0].ae);\n\nconsole.log(get(testObject, 'a.b.c[1].ae2[0]'), testObject.a.b.c[1].ae2[0]);\n\nconsole.log(get(testObject, '[\"test-abc\"].a.b[0][2]'), testObject[\"test-abc\"].a.b[0][2]);\n\nconsole.log(get(testObject.arr, '[0].a.b'), testObject.arr[0].a.b));\n\nconsole.log(get(testObject.arr, '[0].a.b.d.e'), undefined));\n\nset(testObject, '[\"test-abc\"].a.b[0][2]', 5);\nconsole.log(get(testObject, '[\"test-abc\"].a.b[0][2]'), 5);\n\nset(testObject, 'a.b.c[0].ae', 10);\nconsole.log(get(testObject, 'a.b.c[0].ae'), 10);\n\nset(testObject, 'a.b.c[0].ae.d.e.f.g.h', 10);\nconsole.log(get(testObject, 'a.b.c[0].ae.d.e.f.g.h'), undefined);\n\nconsole.log('Test performance');\nconsole.time();\nfor (var i = 0; i \u003c 1000; i++) {\n\tget(testObject, 'a.b.c');\n\tget(testObject, '[\\'abc\"de\"\\']');\n\tget(testObject, '[\\'[abc\"de\"]\\']');\n\tget(testObject, 'a.d[0]');\n\tget(testObject, 'a.b.c[0]');\n\tget(testObject, 'a.b.c[0][\"ae\"]');\n\tget(testObject, 'a.b.c[0].ae');\n\tget(testObject, 'a.b.c[1].ae2[0]');\n\tget(testObject, '[\"test-abc\"].a.b[0][2]');\n\tget(testObject.arr, '[0].a.b');\n\tget(testObject.arr, '[0].a.b.d.e');\n}\nconsole.timeEnd();\n\n\n```\n\n## API\n\n### DeepObject.get(object, path)\n\nWhere `path` is a string like `foo.bar` or `foo.bar[0][1]` or `[0][1].foo['bar']`.\n\nThe path also can be an array: ['foo', 'bar', 0]\n\nThe function will return an VALUE or undefined\n\n### DeepObject.set(object, path, value)\n\nWhere `path` is a string like `foo.bar` or `foo.bar[0][1]` or `[0][1].foo['bar']`.\n\nThe path also can be an array: ['foo', 'bar', 0]\n\nThe function return TRUE or FALSE. Return TRUE if it can set value with the path\n\n### DeepObject.parse(path)\nWhere `path` is a string like `foo.bar` or `foo.bar[0][1]` or `[0][1].foo['bar']`.\n\nThe function will return an array of path;\n\nEx:\n\n`foo.bar` =\u003e `['foo', 'bar']`\n\n`foo.bar[0][1]` =\u003e `['foo', 'bar', 0, 1]` \n\n`[0][1].foo['bar']` =\u003e `[0, 1, 'foo', 'bar']`\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install deep-obj\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xvoidmain%2Fdeep-obj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xvoidmain%2Fdeep-obj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xvoidmain%2Fdeep-obj/lists"}