{"id":25652376,"url":"https://github.com/hyperweb-io/nested-obj","last_synced_at":"2025-09-05T16:11:24.511Z","repository":{"id":230656301,"uuid":"779901337","full_name":"hyperweb-io/nested-obj","owner":"hyperweb-io","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-31T05:21:03.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-07-18T11:44:24.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/hyperweb-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-03-31T05:09:40.000Z","updated_at":"2025-01-18T00:25:04.000Z","dependencies_parsed_at":"2024-03-31T06:32:49.314Z","dependency_job_id":null,"html_url":"https://github.com/hyperweb-io/nested-obj","commit_stats":null,"previous_names":["pyramation/obj-path","hyperweb-io/nested-obj","cosmology-tech/nested-obj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hyperweb-io/nested-obj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fnested-obj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fnested-obj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fnested-obj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fnested-obj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperweb-io","download_url":"https://codeload.github.com/hyperweb-io/nested-obj/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fnested-obj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273782459,"owners_count":25167130,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"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":"2025-02-23T18:17:49.312Z","updated_at":"2025-09-05T16:11:24.495Z","avatar_url":"https://github.com/hyperweb-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nested-obj\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n  \u003ca href=\"https://github.com/pyramation/nested-obj/actions/workflows/run-tests.yaml\"\u003e\n    \u003cimg height=\"20\" src=\"https://github.com/pyramation/nested-obj/actions/workflows/run-tests.yaml/badge.svg\" /\u003e\n  \u003c/a\u003e\n   \u003ca href=\"https://github.com/pyramation/nested-obj/blob/main/LICENSE-MIT\"\u003e\u003cimg height=\"20\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/pyramation/nested-obj/blob/main/LICENSE-Apache\"\u003e\u003cimg height=\"20\" src=\"https://img.shields.io/badge/license-Apache-blue.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`nested-obj` is a simple and lightweight JavaScript utility library for safely accessing and modifying nested properties in objects using string paths.\n\n## Features\n\n- **Get**: Safely access nested properties in an object.\n- **Set**: Set a value at a specific path in an object. Does not overwrite if the value is undefined.\n- **Has**: Check if a specific path exists within an object.\n\n## Installation\n\n```bash\nnpm install nested-obj\n```\n\n## Usage\n\n### Get\n\nRetrieve a nested property value from an object.\n\n```ts\nimport objectPath from 'nested-obj';\n\nconst obj = {\n  user: {\n    name: 'John Doe',\n    address: {\n      street: '123 Main St',\n      city: 'Anytown'\n    }\n  }\n};\n\nconst userName = objectPath.get(obj, 'user.name');\nconsole.log(userName); // 'John Doe'\n```\n\n### Set\n\nSet a value at a specific path in an object. If any part of the path does not exist, it will be created.\n\n```ts\nobjectPath.set(obj, 'user.address.zip', '12345');\nconsole.log(obj.user.address.zip); // '12345'\n```\n\n### Has\n\nCheck if a path exists within an object.\n\n```ts\nconst hasCity = objectPath.has(obj, 'user.address.city');\nconsole.log(hasCity); // true\n```\n\n## Running Tests\n\nTo run tests, execute the following command:\n\n```sh\nnpm test\n```\n\nor for continuous\n\n```sh\nnpm test:watch\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperweb-io%2Fnested-obj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperweb-io%2Fnested-obj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperweb-io%2Fnested-obj/lists"}