{"id":18948711,"url":"https://github.com/iamnapo/get","last_synced_at":"2025-04-15T23:30:59.679Z","repository":{"id":57117176,"uuid":"296247234","full_name":"iamnapo/get","owner":"iamnapo","description":"🔍 Get the value at a specific object (or string) path, without caring if it exists.","archived":false,"fork":false,"pushed_at":"2020-10-17T17:10:30.000Z","size":20,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-07T21:50:07.685Z","etag":null,"topics":["array","get","object","path","string"],"latest_commit_sha":null,"homepage":"https://npm.im/@iamnapo/get","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/iamnapo.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}},"created_at":"2020-09-17T07:08:33.000Z","updated_at":"2021-02-01T02:14:11.000Z","dependencies_parsed_at":"2022-08-23T04:40:28.585Z","dependency_job_id":null,"html_url":"https://github.com/iamnapo/get","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/iamnapo%2Fget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamnapo","download_url":"https://codeload.github.com/iamnapo/get/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223688667,"owners_count":17186298,"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":["array","get","object","path","string"],"created_at":"2024-11-08T13:14:25.478Z","updated_at":"2024-11-08T13:14:27.869Z","avatar_url":"https://github.com/iamnapo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @iamnapo/get\n\n\u003e Get the value at a specific object (or string) path, without caring if it exists\n\n[![build](https://img.shields.io/github/workflow/status/iamnapo/get/ci?style=for-the-badge\u0026logo=github\u0026label=)](https://github.com/iamnapo/get/actions) [![npm](https://img.shields.io/npm/v/@iamnapo/get.svg?style=for-the-badge\u0026logo=npm\u0026label=)](https://www.npmjs.com/package/@iamnapo/get) [![size](https://img.shields.io/bundlephobia/min/@iamnapo/get.svg?style=for-the-badge\u0026label=size)](https://bundlephobia.com/result?p=@iamnapo/get) [![license](https://img.shields.io/github/license/iamnapo/get.svg?style=for-the-badge)](./LICENSE)\n\n## Install\n\n```sh\n$ npm i @iamnapo/get\n```\n\n## Usage\n\n```js\nconst get = require(\"@iamnapo/get\");\n\nget([4, 5], \"[0]\"); // =\u003e 4\nget({ a: { b: 1 } }, \"a.b\"); // =\u003e 1\nget({ a: { b: 1 } }, \"a.c\", \"blah\"); // =\u003e \"blah\"\nget(\"napo\", \"[1]\"); // =\u003e \"a\"\n```\n\n## API\n\n### get(object, path, defaultValue?)\n\nGet `path` of `object`, returning `defaultValue` if it doesn‘t exist.\n\n#### object\n\nType: `object | Array | string`\n\nBase object to get value from.\n\n#### path\n\nType: `string`\n\nPath to get value at.\n\n#### defaultValue\n\nType: `string`\\\nDefault: `undefined`\n\nReturn value if path doesn‘t exist.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnapo%2Fget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamnapo%2Fget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnapo%2Fget/lists"}