{"id":37378750,"url":"https://github.com/kesarawimal/compare-strings","last_synced_at":"2026-01-16T05:05:10.497Z","repository":{"id":57204562,"uuid":"192866382","full_name":"kesarawimal/compare-strings","owner":"kesarawimal","description":"Finds degree of similarity between two strings, based on Dice's Coefficient and Levenshtein Distance.","archived":false,"fork":false,"pushed_at":"2019-06-21T09:40:03.000Z","size":6,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-23T20:18:53.591Z","etag":null,"topics":["dice-coefficient","javascript","string-comparison","string-similarity","strings"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/compare-strings","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/kesarawimal.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":"2019-06-20T06:56:41.000Z","updated_at":"2022-10-17T15:31:13.000Z","dependencies_parsed_at":"2022-09-18T00:42:08.181Z","dependency_job_id":null,"html_url":"https://github.com/kesarawimal/compare-strings","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kesarawimal/compare-strings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesarawimal%2Fcompare-strings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesarawimal%2Fcompare-strings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesarawimal%2Fcompare-strings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesarawimal%2Fcompare-strings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kesarawimal","download_url":"https://codeload.github.com/kesarawimal/compare-strings/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kesarawimal%2Fcompare-strings/sbom","scorecard":{"id":556230,"data":{"date":"2025-08-11","repo":{"name":"github.com/kesarawimal/compare-strings","commit":"0355cc02e1e9c18992fb0a23637b92114caddf00"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T12:25:12.774Z","repository_id":57204562,"created_at":"2025-08-20T12:25:12.774Z","updated_at":"2025-08-20T12:25:12.774Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dice-coefficient","javascript","string-comparison","string-similarity","strings"],"created_at":"2026-01-16T05:05:07.381Z","updated_at":"2026-01-16T05:05:10.486Z","avatar_url":"https://github.com/kesarawimal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"compare-strings\n=================\n\nFinds degree of similarity between two strings, based on [Dice's Coefficient](http://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient) and [Levenshtein Distance](http://en.wikipedia.org/wiki/Levenshtein_distance).\n\n## Table of Contents\n\n* [Usage](#usage)\n* [API](#api)\n    * [compareTwoStrings(string1, string2)](#comparetwostringsstring1-string2)\n        * [Arguments](#arguments)\n        * [Returns](#returns)\n        * [Examples](#examples)\n\n\n## Usage\nInstall using:\n\n```shell\nnpm install compare-strings --save\n```\n\nIn your code:\n\n```javascript\nvar compareStrings = require('compare-strings');\n\nvar similarity = compareStrings('healed', 'sealed');\n```\n## API\n\n### compareStrings(string1, string2)\n\nReturns a fraction between 0 and 1, which indicates the degree of similarity between the two strings. 0 indicates completely different strings, 1 indicates identical strings. The comparison is case-insensitive.\n\n##### Arguments\n  \n1. string1 (string): The first string\n2. string2 (string): The second string\n  \nOrder does not make a difference.\n  \n##### Returns\n  \n(number): A fraction from 0 to 1, both inclusive. Higher number indicates more similarity.\n\n##### Examples\n  \n```javascript\nstringSimilarity.compareTwoStrings('healed', 'sealed');\n// → 0.8166666666666667\n\nstringSimilarity.compareTwoStrings('Olive-green table for sale, in extremely good condition.', \n  'For sale: table in very good  condition, olive green in colour.');\n// → 0.4774114774114774\n\nstringSimilarity.compareTwoStrings('Olive-green table for sale, in extremely good condition.', \n  'For sale: green Subaru Impreza, 210,000 miles');\n// → 0.27886002886002886\n\nstringSimilarity.compareTwoStrings('Olive-green table for sale, in extremely good condition.', \n  'Wanted: mountain bike with at least 21 gears.');\n// → 0.159992784992785\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkesarawimal%2Fcompare-strings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkesarawimal%2Fcompare-strings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkesarawimal%2Fcompare-strings/lists"}