{"id":17445966,"url":"https://github.com/jamen/pull-prop","last_synced_at":"2025-04-02T10:43:07.174Z","repository":{"id":96785127,"uuid":"90630355","full_name":"jamen/pull-prop","owner":"jamen","description":"Select a property and replace inside an object","archived":false,"fork":false,"pushed_at":"2017-05-08T14:06:33.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-09T19:35:53.036Z","etag":null,"topics":[],"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/jamen.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,"publiccode":null,"codemeta":null}},"created_at":"2017-05-08T13:20:08.000Z","updated_at":"2021-12-19T15:38:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"f73c8d2c-2890-42bc-a4a9-86e443950301","html_url":"https://github.com/jamen/pull-prop","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"18350eab27be7f18b99ee23984d818cfe32db60c"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/pull-prop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246802594,"owners_count":20836365,"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":[],"created_at":"2024-10-17T18:19:10.019Z","updated_at":"2025-04-02T10:43:07.142Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# pull-prop\n\n\u003e Map an object's property with a stream\n\n```js\npull(\n  values([\n    { foo: { bar: 123 } },\n    { foo: { bar: 321 } },\n    { foo: { bar: 333 } }\n  ]),\n  prop('foo.bar', () =\u003e pull(\n    map(bar =\u003e bar * 3)\n  ))\n  drain(obj =\u003e {\n    // ...\n  })\n)\n```\n\n## Install\n\n```sh\nnpm install --save pull-property\n\n# with yarn\nyarn add pull-property\n```\n\n## Usage\n\n### `prop(name, transform)`\n\nA through stream that takes and gives objects, replacing a certain property on them.\n\n - `name`: The property you are mapping (resolved by [`object-path`](https://www.npmjs.com/package/object-path))\n - `transform`: A function that returns a through stream, which maps the property\n\nAn psuedo example with [`pull-files`](https://npmjs.com/pull-files):\n\n```js\npull(\n  read('lib/**/*.js'),\n  // Map `data` with buf -\u003e buf streams:\n  prop('data', () =\u003e pull(\n    map(babel.transformSync),\n    map(uglify.compileSync),\n    // ...\n  )),\n  write('out', err =\u003e {\n    if (err) throw err\n  })\n)\n```\n\n---\n\nMaintained by [Jamen Marz](https://git.io/jamen) (See on [Twitter](https://twitter.com/jamenmarz) and [GitHub](https://github.com/jamen) for questions \u0026 updates)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fpull-prop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Fpull-prop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fpull-prop/lists"}