{"id":21387581,"url":"https://github.com/nju33/poipoi","last_synced_at":"2025-03-16T12:33:05.586Z","repository":{"id":57326749,"uuid":"86982008","full_name":"nju33/poipoi","owner":"nju33","description":"💉 To inject data into a class method","archived":false,"fork":false,"pushed_at":"2017-04-02T11:38:10.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T12:49:42.392Z","etag":null,"topics":["decorator","injector","javascript","method"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/poipoi","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nju33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-02T11:33:34.000Z","updated_at":"2017-04-02T11:38:35.000Z","dependencies_parsed_at":"2022-09-21T01:51:41.000Z","dependency_job_id":null,"html_url":"https://github.com/nju33/poipoi","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/nju33%2Fpoipoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nju33%2Fpoipoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nju33%2Fpoipoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nju33%2Fpoipoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nju33","download_url":"https://codeload.github.com/nju33/poipoi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243869178,"owners_count":20360967,"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":["decorator","injector","javascript","method"],"created_at":"2024-11-22T12:13:44.953Z","updated_at":"2025-03-16T12:33:05.564Z","avatar_url":"https://github.com/nju33.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poipoi\n\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\n💉 To inject data into a class method.\n\n## Install\n\n```bash\nyarn add poipoi\nnpm i -S poipoi\n```\n\n## Usage\n\n```js\nimport Poipoi from 'poipoi';\n\nconst a = new Poipoi({foo: 'foo'});\na.set({\n  bar: 'bar',\n  baz: 'baz'\n});\n\nconst b = new Poipoi({hoge: 'hoge'});\n\nclass Foo {\n  // somethingMethod(b-obj, a-obj, ...args)\n  @a.inject('foo', 'baz')\n  @b.inject('hoge')\n  somethingMethod({hoge}, {foo, baz}, ...args) {}\n}\n```\n\n## API\n\n### `constructor(initialValue = {})`\n\n- `initialValue`: `Object`\n\n### `set(value)`\n\n- `value`: `Object`\n\nOverwriting data.\n\n### `get(name = null)`\n\n- `name`: `String`\n\nGet data by `name`. If it is `null`, return it all.\n\n### `clear()`\n\nDelete all data\n\n### `inject(...names)`\n\n- `name`: `String`\n\nInject data written in `names` to the class method.\n\n## Lisence\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 nju33 \u003cnju33.ki@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnju33%2Fpoipoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnju33%2Fpoipoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnju33%2Fpoipoi/lists"}