{"id":17291891,"url":"https://github.com/eklem/leven-match","last_synced_at":"2025-04-14T11:52:17.691Z","repository":{"id":38822484,"uuid":"265671131","full_name":"eklem/leven-match","owner":"eklem","description":"Return all word matches between two arrays within given Levenshtein distance","archived":false,"fork":false,"pushed_at":"2024-09-28T04:42:56.000Z","size":1652,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-04-10T06:00:05.334Z","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/eklem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-05-20T19:45:46.000Z","updated_at":"2024-09-28T04:42:56.000Z","dependencies_parsed_at":"2024-06-16T19:44:07.206Z","dependency_job_id":"be995de4-ce39-4684-bab6-19e06b47014c","html_url":"https://github.com/eklem/leven-match","commit_stats":{"total_commits":127,"total_committers":2,"mean_commits":63.5,"dds":0.3228346456692913,"last_synced_commit":"95166b34696684be9da35119e55790c3c0209a2b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eklem%2Fleven-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eklem%2Fleven-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eklem%2Fleven-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eklem%2Fleven-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eklem","download_url":"https://codeload.github.com/eklem/leven-match/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877991,"owners_count":21176239,"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-15T10:42:11.531Z","updated_at":"2025-04-14T11:52:17.656Z","avatar_url":"https://github.com/eklem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leven-match\n\n[![NPM version][npm-version-image]][npm-url]\n[![NPM downloads][npm-downloads-image]][npm-url]\n[![](https://data.jsdelivr.com/v1/package/npm/leven-match/badge?style=rounded)](https://www.jsdelivr.com/package/npm/leven-match)\n[![MIT License][license-image]][license-url]\n[![Build Status][build-image]][build-url]\n[![JavaScript Style Guide][standardjs-image]][standardjs-url]\n\nReturn all word matches between two arrays within given Levenshtein distance.\n\nIntended use is to return all words in a query that has matches in an index within a given Levenshtein distance. Good for autocomplete type functionality, and in some cases also searching.\n\nPart of [daq-proc](https://github.com/eklem/daq-proc) - Simple document and query processing for offline-first search.\n\n## Breaking change\n\nImporting/requiring script has changed slightly for CJS and ESM. UMD is as it was.\n\n## Initiating\n\n### UMD -  Universal module definition/browser\n```javaScript\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/leven-match/dist/leven-match.umd.min.js\"\u003e\u003c/script\u003e\n// lvm.levenMatch available\n```\n\n### CJS - CommonJS\n\n```javaScript\nconst { levenMatch } = require('leven-match')\n// levenMatch available\n```\n\n### ESM - Ecmascript module\n\n```javaScript\nimport { levenMatch } from 'leven-match'\n// levenMatch available\n```\n\n\n## Use\n\n```javaScript\n\u003cscript\u003e\n  const index = ['return', 'all', 'word', 'matches', 'between', 'two', 'arrays', 'within', 'given', 'levenshtein', 'distance', 'intended', 'use', 'is', 'to', 'words', 'in', 'a', 'query', 'that', 'has', 'an', 'index', 'good', 'for', 'autocomplete', 'type', 'functionality,', 'and', 'some', 'cases', 'also', 'searching']\n  const query = ['qvery', 'words', 'levensthein']\n\n  levenMatch(query, index, {distance: 2})\n  // returns:\n  //[ [ 'query' ], [ 'word', 'words' ], [ 'levenshtein' ] ]\n\u003c/script\u003e\n```\n\nReturns an array of arrays. One sub-array for each query word.\n\n\n[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]: LICENSE\n[npm-url]: https://npmjs.org/package/leven-match\n[npm-version-image]: https://img.shields.io/npm/v/leven-match.svg?style=flat\n[npm-downloads-image]: https://img.shields.io/npm/dm/leven-match.svg?style=flat\n[build-url]: https://github.com/eklem/leven-match/actions/workflows/tests.yml\n[build-image]: https://github.com/eklem/leven-match/actions/workflows/tests.yml/badge.svg\n[standardjs-url]: https://standardjs.com\n[standardjs-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feklem%2Fleven-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feklem%2Fleven-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feklem%2Fleven-match/lists"}