{"id":17419161,"url":"https://github.com/axtgr/match-store","last_synced_at":"2025-06-13T06:07:41.927Z","repository":{"id":57291860,"uuid":"74813473","full_name":"axtgr/match-store","owner":"axtgr","description":"A JavaScript storage that uses a function to match keys when retrieving values","archived":false,"fork":false,"pushed_at":"2016-12-03T07:31:48.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T06:05:07.012Z","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/axtgr.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":"2016-11-26T08:18:28.000Z","updated_at":"2016-12-03T07:31:02.000Z","dependencies_parsed_at":"2022-08-27T12:20:35.524Z","dependency_job_id":null,"html_url":"https://github.com/axtgr/match-store","commit_stats":null,"previous_names":["alex-shnayder/match-store","alex-shnayder/wildcard-store"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/axtgr/match-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtgr%2Fmatch-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtgr%2Fmatch-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtgr%2Fmatch-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtgr%2Fmatch-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axtgr","download_url":"https://codeload.github.com/axtgr/match-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtgr%2Fmatch-store/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259592261,"owners_count":22881266,"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-17T02:17:03.073Z","updated_at":"2025-06-13T06:07:41.902Z","avatar_url":"https://github.com/axtgr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# match-store\n\nA simple JavaScript storage that puts values into arrays at a specified key and uses a matching function to retrieve them. Most suitable for event emitters when used with [wildcard-match](https://github.com/alex-shnayder/wildcard-match).\n\n\n## Installation\n\n`npm install --save match-store`\n\n\n## Usage\n\n```javascript\nlet Store = require('match-store');\n\n// Settings are optional\nlet store = new Store({\n  prefix: '~', // key prefix for the internal storage to avoid clashes\n  match: function areOfSameLength(a, b) { // this function is used to match the keys when retrieving values\n    return a.length === b.length;\n  }\n});\n\n\nstore.put('one.two.three', 'foo');\nstore.put('four.five.six', 'bar', 1);\nstore.put('seven', 'baz');\n\nstore.get('thirteenchars'); // ['foo', 'bar'] because the matching function only checks the length\nstore.get('same---length'); // ['foo'] because 'bar' had a limit of 1 retrieval\n```\n\n\n## API\n\n### `put(key, value, [uses])`\n\nSaves the value to the internal storage at the specified key. The third parameter limits the number of times the value can be retrieved.\n\n### `get(key)`\n\nReturns an array of values with matching keys. Uses the `match` function provided in the settings to match the keys. If no function is set, checks the keys for equality.\n\n### `del(key, [value])`\n\nRemoves values whose keys *exactly* match the provided one. If a value is provided, deletes only records that are equal to it.\n\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtgr%2Fmatch-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxtgr%2Fmatch-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtgr%2Fmatch-store/lists"}