{"id":22733469,"url":"https://github.com/strikeentco/get","last_synced_at":"2025-04-14T01:54:18.486Z","repository":{"id":57163155,"uuid":"125674640","full_name":"strikeentco/get","owner":"strikeentco","description":"Get a property from a nested object using a dot path or custom separator","archived":false,"fork":false,"pushed_at":"2018-07-20T09:58:53.000Z","size":66,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T01:54:12.955Z","etag":null,"topics":["deep","dot","dot-path","dot-prop","fast","get","get-deep","javascript","key","lodash","lodash-get","nested-value","nodejs","object","object-path","path","small","value"],"latest_commit_sha":null,"homepage":"","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/strikeentco.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":"2018-03-17T22:40:36.000Z","updated_at":"2023-12-05T06:33:24.000Z","dependencies_parsed_at":"2022-09-01T00:20:38.575Z","dependency_job_id":null,"html_url":"https://github.com/strikeentco/get","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strikeentco","download_url":"https://codeload.github.com/strikeentco/get/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809032,"owners_count":21164895,"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":["deep","dot","dot-path","dot-prop","fast","get","get-deep","javascript","key","lodash","lodash-get","nested-value","nodejs","object","object-path","path","small","value"],"created_at":"2024-12-10T20:14:42.928Z","updated_at":"2025-04-14T01:54:18.465Z","avatar_url":"https://github.com/strikeentco.png","language":"JavaScript","readme":"get [![License](https://img.shields.io/npm/l/@strikeentco/get.svg)](https://github.com/strikeentco/get/blob/master/LICENSE)  [![npm](https://img.shields.io/npm/v/@strikeentco/get.svg)](https://www.npmjs.com/package/@strikeentco/get)\n==========\n[![Build Status](https://travis-ci.org/strikeentco/get.svg)](https://travis-ci.org/strikeentco/get)  [![node](https://img.shields.io/node/v/@strikeentco/get.svg)](https://www.npmjs.com/package/@strikeentco/get) [![Test Coverage](https://api.codeclimate.com/v1/badges/83783b3523a8819e5d34/test_coverage)](https://codeclimate.com/github/strikeentco/get/test_coverage)\n\nOne of the smallest (*23 sloc*) and most effective implementations of getting a nested value from an object.\n\n# Usage\n\n```sh\n$ npm install @strikeentco/get --save\n```\n\n```javascript\nconst get = require('@strikeentco/get');\n\nget({ a: { b: 'c' } }, 'a.b');\n//=\u003e 'c'\n\nget({ a: { b: ['c', 'd'] } }, 'a.b.1');\n//=\u003e 'd'\n\nget({ a: { b: ['c', 'd'] } }, ['a', 'b']);\n//=\u003e ['c', 'd']\n\nget({ a: { b: 'c' } }, 'a.b.c.d');\n//=\u003e undefined\n\nget({ a: { b: 'c' } }, 'a:b', ':');\n//=\u003e 'c'\n```\n## API\n\n### get(obj, path, [separator])\n\n#### Params:\n* **obj** (*Object*) - Source object.\n* **path** (*String|Array*) - String or array with path.\n* **[separator]** (*String*) - `.` by default.\n\n## Benchmarks\n*(benchmarks were run on a Intel Core i5-6200U @ 2.30 GHz, 8 GB 2133 MHz DDR4)*\n\n```\n# deep.js (175 bytes)\n  dot-prop x 633,102 ops/sec ±1.19% (85 runs sampled)\n  get-value x 1,138,909 ops/sec ±1.80% (87 runs sampled)\n  get x 2,066,525 ops/sec ±0.99% (90 runs sampled) - this library\n  getobject x 170,159 ops/sec ±1.17% (88 runs sampled)\n  lodash.get x 1,847,112 ops/sec ±0.60% (89 runs sampled)\n  object-path x 126,724 ops/sec ±2.33% (86 runs sampled)\n\n  fastest is get - this library\n\n# root.js (210 bytes)\n  dot-prop x 3,056,017 ops/sec ±1.84% (86 runs sampled)\n  get-value x 11,121,668 ops/sec ±1.04% (87 runs sampled)\n  get x 4,160,982 ops/sec ±1.06% (88 runs sampled) - this library\n  getobject x 1,004,785 ops/sec ±1.19% (88 runs sampled)\n  lodash.get x 6,529,634 ops/sec ±0.69% (90 runs sampled)\n  object-path x 1,976,993 ops/sec ±1.97% (86 runs sampled)\n\n  fastest is get-value\n\n# shallow.js (84 bytes)\n  dot-prop x 1,965,057 ops/sec ±1.64% (89 runs sampled)\n  get-value x 2,697,800 ops/sec ±1.13% (87 runs sampled)\n  get x 3,529,218 ops/sec ±1.13% (87 runs sampled) - this library\n  getobject x 576,927 ops/sec ±1.04% (88 runs sampled)\n  lodash.get x 3,145,038 ops/sec ±2.11% (87 runs sampled)\n  object-path x 595,264 ops/sec ±3.33% (82 runs sampled)\n\n  fastest is get - this library\n```\n\nBenchmark from [`jonschlinkert/get-value`](https://github.com/jonschlinkert/get-value/tree/master/benchmark) library.\n\n## License\n\nThe MIT License (MIT)\u003cbr/\u003e\nCopyright (c) 2018 Alexey Bystrov\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrikeentco%2Fget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrikeentco%2Fget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrikeentco%2Fget/lists"}