{"id":22828672,"url":"https://github.com/busterc/similars","last_synced_at":"2025-06-16T04:14:15.903Z","repository":{"id":57359666,"uuid":"127320404","full_name":"busterc/similars","owner":"busterc","description":":dancers: Find similar objects and partial duplicates in collections","archived":false,"fork":false,"pushed_at":"2018-08-25T22:00:35.000Z","size":78,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T08:52:11.428Z","etag":null,"topics":["arrays","collections","duplicate-detection","duplicates","similar-objects","similarity-search"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/busterc.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":"2018-03-29T16:47:14.000Z","updated_at":"2023-09-08T17:38:36.000Z","dependencies_parsed_at":"2022-09-06T22:22:21.508Z","dependency_job_id":null,"html_url":"https://github.com/busterc/similars","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/busterc/similars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fsimilars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fsimilars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fsimilars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fsimilars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/busterc","download_url":"https://codeload.github.com/busterc/similars/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fsimilars/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260094349,"owners_count":22957855,"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":["arrays","collections","duplicate-detection","duplicates","similar-objects","similarity-search"],"created_at":"2024-12-12T19:11:20.749Z","updated_at":"2025-06-16T04:14:15.880Z","avatar_url":"https://github.com/busterc.png","language":"JavaScript","readme":"# similars [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]\n\n\u003e Find similar objects and partial duplicates in collections\n\n## Installation\n\n```sh\n$ npm install --save similars\n```\n\n## Usage\n\n```js\nconst similars = require('similars');\n\nconst bobs = [\n  { fn: 'BOB', ln: 'DYLAN', p: 'Musician' },\n  { fn: 'B', ln: 'Marley', p: 'Singer' },\n  { fn: 'Bob', ln: 'Dylan', p: 'SINGER' },\n  { fn: 'Bobby', ln: 'Dylan', p: 'MUSICIAN' },\n  { fn: 'BOB', ln: 'MARLEY', p: 'MUSICIAN' }\n];\n\n// Find Bobs with the same last name (ln) and profession (p)\nsimilars(\n  bobs,\n  (a, b) =\u003e\n    a.ln.toLowerCase() === b.ln.toLowerCase() \u0026\u0026\n    a.p.toLowerCase() === b.p.toLowerCase()\n).then(found =\u003e {\n  console.log(found);\n  /*\n    [\n      { fn: 'BOB', ln: 'DYLAN', p: 'Musician' },\n      { fn: 'Bobby', ln: 'Dylan', p: 'MUSICIAN' }\n    ]\n  */\n});\n```\n\n## API\n\n### `similars(collection, matcher[, onEach])`\n\nReturns a `Promise`, however, processing is synchronous\n\n* #### `collection`\n  * `Required` : `Array` containing objects\n* #### `matcher`\n  * `Required` : `Function` that compares each item in the collection and returns a `Boolean`\n  * e.g. `(a, b) =\u003e a.name.toLowerCase() === b.name.toLowerCase()`\n* #### `onEach`\n  * `Optional` : `Function` that executes once for each item in the `collection`\n  * Is good for showing [progress](https://github.com/visionmedia/node-progress) on long running executions\n\n## License\n\nISC © [Buster Collings](https://about.me/buster)\n\n[npm-image]: https://badge.fury.io/js/similars.svg\n[npm-url]: https://npmjs.org/package/similars\n[travis-image]: https://travis-ci.org/busterc/similars.svg?branch=master\n[travis-url]: https://travis-ci.org/busterc/similars\n[daviddm-image]: https://david-dm.org/busterc/similars.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/busterc/similars\n[coveralls-image]: https://coveralls.io/repos/busterc/similars/badge.svg\n[coveralls-url]: https://coveralls.io/r/busterc/similars\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fsimilars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusterc%2Fsimilars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fsimilars/lists"}