{"id":16295109,"url":"https://github.com/wadackel/dot-wild-tiny","last_synced_at":"2026-05-02T06:37:01.294Z","repository":{"id":57215344,"uuid":"114441892","full_name":"wadackel/dot-wild-tiny","owner":"wadackel","description":"Use powerful dot notation (dot path + wildcard) to access properties of JSON","archived":false,"fork":false,"pushed_at":"2017-12-17T03:19:02.000Z","size":21,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-12T09:18:07.901Z","etag":null,"topics":["dot-notation","json","typescript"],"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/wadackel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-12-16T07:17:09.000Z","updated_at":"2021-07-23T01:45:46.000Z","dependencies_parsed_at":"2022-08-29T02:11:09.648Z","dependency_job_id":null,"html_url":"https://github.com/wadackel/dot-wild-tiny","commit_stats":null,"previous_names":["tsuyoshiwada/dot-wild-tiny"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fdot-wild-tiny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fdot-wild-tiny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fdot-wild-tiny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Fdot-wild-tiny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wadackel","download_url":"https://codeload.github.com/wadackel/dot-wild-tiny/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045266,"owners_count":21038555,"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":["dot-notation","json","typescript"],"created_at":"2024-10-10T20:17:38.130Z","updated_at":"2026-05-02T06:37:01.266Z","avatar_url":"https://github.com/wadackel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dot-wild-tiny\n\n[![Build Status](http://img.shields.io/travis/tsuyoshiwada/dot-wild-tiny.svg?style=flat-square)](https://travis-ci.org/tsuyoshiwada/dot-wild-tiny)\n[![npm version](https://img.shields.io/npm/v/dot-wild-tiny.svg?style=flat-square)](http://badge.fury.io/js/dot-wild-tiny)\n\n\u003e Use powerful dot notation (dot path + wildcard) to access properties of JSON.  \n\u003e If you need to do set or delete, use [dot-wild](https://github.com/tsuyoshiwada/dot-wild) which has all functions.\n\n\n\n\n## Table of Contents\n\n* [Install](#install)\n* [Usage](#usage)\n* [Contribute](#contribute)\n* [Related projects](#related-projects)\n* [License](#license)\n\n\n\n\n## Install\n\n```bash\n$ npm install dot-wild-tiny --save\n\n# or\n\n$ yarn add dot-wild-tiny\n```\n\n\n\n\n## Usage\n\n```javascript\nimport * as dot from 'dot-wild-tiny';\n\n\n/**\n * Getter\n */\ndot.get({ foo: { bar: 'baz' } }, 'foo.bar');\n// =\u003e 'baz'\n\ndot.get({ 'foo.bar': 'baz' }, 'foo\\\\.bar');\n// =\u003e 'baz'\n\ndot.get({ 'foo.bar': 'baz' }, 'notfound', 'default');\n// =\u003e 'default'\n\nconst authorData = {\n  authors: [\n    { username: 'tsuyoshiwada', profile: { age: 24 } },\n    { username: 'sampleuser', profile: { age: 30 } },\n    { username: 'foobarbaz', profile: { age: 33 } }\n  ]\n};\n\ndot.get(authorData, 'authors.*.username');\n// =\u003e ['tsuyoshiwada', 'sampleuser', 'foobarbaz']\n\ndot.get(authorData, 'authors.*.profile.age');\n// =\u003e [24, 30, 33]\n\n\n/**\n * Collection helpers (forEach, map)\n */\ndot.forEach(postData, 'data.posts.*.id', (value, key, context, path, data) =\u003e {\n  // value   =\u003e 1, 2\n  // key     =\u003e 'id', 'id'\n  // context =\u003e { id: 1, title: 'post 1' }, { id: 2, title: 'post 2' }\n  // path    =\u003e 'data.posts.0.id', 'data.posts.1.id'\n  // data    =\u003e postData...\n});\n\ndot.map(postData, 'data.tags.*.name', (value, key, context, path, data) =\u003e {\n  return `${dot.get(data, path)} === ${value} (${key})`;\n});\n// =\u003e ['tag 1 === tag 1 (name)', 'tag 2 === tag 2 (name)']\n```\n\n\n\n\n## Contribute\n\n1. Fork it!\n1. Create your feature branch: git checkout -b my-new-feature\n1. Commit your changes: git commit -am 'Add some feature'\n1. Push to the branch: git push origin my-new-feature\n1. Submit a pull request :D\n\nBugs, feature requests and comments are more than welcome in the [issues](https://github.com/tsuyoshiwada/dot-wild-tiny/issues).\n\n\n\n\n## Related projects\n\n* [dot-wild](https://github.com/tsuyoshiwada/dot-wild)\n\n\n\n\n## License\n\n[MIT © tsuyoshiwada](./LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Fdot-wild-tiny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwadackel%2Fdot-wild-tiny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Fdot-wild-tiny/lists"}