{"id":15663620,"url":"https://github.com/jonschlinkert/expand-value","last_synced_at":"2025-05-06T15:28:53.174Z","repository":{"id":57231713,"uuid":"387972822","full_name":"jonschlinkert/expand-value","owner":"jonschlinkert","description":"Expand deeply nested values from an object, with support for advanced features","archived":false,"fork":false,"pushed_at":"2023-01-10T18:23:23.000Z","size":24,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-28T22:46:44.811Z","etag":null,"topics":["access","accessor","dot-prop","get","get-properties","get-property","get-value","nested","object","recursive","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/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["jonschlinkert"]}},"created_at":"2021-07-21T02:45:22.000Z","updated_at":"2024-01-03T20:05:28.000Z","dependencies_parsed_at":"2023-02-08T19:40:11.766Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/expand-value","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fexpand-value","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fexpand-value/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fexpand-value/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fexpand-value/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/expand-value/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252712610,"owners_count":21792344,"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":["access","accessor","dot-prop","get","get-properties","get-property","get-value","nested","object","recursive","value"],"created_at":"2024-10-03T13:38:57.022Z","updated_at":"2025-05-06T15:28:53.144Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jonschlinkert"],"categories":[],"sub_categories":[],"readme":"# expand-value [![NPM version](https://img.shields.io/npm/v/expand-value.svg?style=flat)](https://www.npmjs.com/package/expand-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/expand-value.svg?style=flat)](https://npmjs.org/package/expand-value) [![NPM total downloads](https://img.shields.io/npm/dt/expand-value.svg?style=flat)](https://npmjs.org/package/expand-value)\n\n\u003e Expand deeply nested values from an object, with support for advanced features.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) \u003e=14):\n\n```sh\n$ npm install --save expand-value\n```\n\n## Usage\n\nSimilar to [get-value](https://github.com/jonschlinkert/get-value) and [dot-prop](https://github.com/sindresorhus/dot-prop) (and passes all of the `get-value` unit tests), but supports more complex expressions for accessing deeply nested properties. For example, this library is used by [Dry](https://github.com/jonschlinkert/dry) for resolving values in expressions in user-defined templates.\n\n```js\nconst expand = require('expand-value');\n\nconst data = { user: { name: 'Brian' }, key: 'name' };\n\nconsole.log(expand(data, 'user.name')) //=\u003e 'Brian'\nconsole.log(expand(data, 'user[\"name\"]')) //=\u003e 'Brian'\nconsole.log(expand(data, 'user[key]')) //=\u003e 'Brian'\n\nconsole.log(expand({ foo: { bar: { baz: 'correct' } } }, 'foo[\"bar\"].baz')); //=\u003e 'correct'\n```\n\n## .parse\n\n```js\nconst { parse } = require('expand-value);\nconst { ast } = parse('a.b.c');\n\nconsole.log(ast);\n\n// results in\n{\n  type: 'root',\n  nodes: [\n    { type: 'ident', value: 'a' },\n    { type: 'separator', value: '.' },\n    { type: 'ident', value: 'b' },\n    { type: 'separator', value: '.' },\n    { type: 'ident', value: 'c' }\n  ]\n}\n```\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2021, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 20, 2021._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fexpand-value","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fexpand-value","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fexpand-value/lists"}