Installations
npm install js-levenshtein-esm
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.11.0
NPM Version
6.4.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (94.87%)
TypeScript (5.13%)
Developer
43081j
Download Statistics
Total Downloads
4,604,938
Last Day
6,148
Last Week
27,332
Last Month
131,564
Last Year
1,973,185
GitHub Statistics
1 Stars
39 Commits
1 Forks
4 Watching
1 Branches
1 Contributors
Bundle Size
958.00 B
Minified
504.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.2.0
Package Id
js-levenshtein-esm@1.2.0
Size
3.03 kB
NPM Version
6.4.1
Node Version
10.11.0
Publised On
25 Feb 2019
Total Downloads
Cumulative downloads
Total Downloads
4,604,938
Last day
-12.2%
6,148
Compared to previous day
Last week
-16.1%
27,332
Compared to previous week
Last month
3.9%
131,564
Compared to previous month
Last year
66.3%
1,973,185
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
js-levenshtein-esm
This is a fork of js-levenshtein rewritten for ES module consumption.
A very efficient JS implementation calculating the Levenshtein distance, i.e. the difference between two strings.
Based on Wagner-Fischer dynamic programming algorithm, optimized for speed and memory
- use a single distance vector instead of a matrix
- loop unrolling on the outer loop
- remove common prefixes/postfixes from the calculation
- minimize the number of comparisons
Install
$ npm i -S js-levenshtein-esm
Usage
In Node:
1const levenshtein = require('js-levenshtein-esm'); 2 3levenshtein('kitten', 'sitting'); // 3
In the browser:
1import levenshtein from 'https://unpkg.com/js-levenshtein-esm/js-levenshtein.js'; 2 3levenshtein('kitten', 'sitting'); // 3
Benchmark
$ npm run test:perf
50 paragraphs, length max=500 min=240 avr=372.5
62 op/s � fast-levenshtein
143 op/s � js-levenshtein
140 op/s � js-levenshtein-esm
89 op/s � leven
92 op/s � levenshtein-edit-distance
100 op/s � talisman
100 sentences, length max=170 min=6 avr=57.5
1,304 op/s � fast-levenshtein
2,829 op/s � js-levenshtein
2,750 op/s � js-levenshtein-esm
1,780 op/s � leven
1,788 op/s � levenshtein-edit-distance
2,097 op/s � talisman
2000 words, length max=20 min=3 avr=9.5
1,952 op/s � fast-levenshtein
3,104 op/s � js-levenshtein
2,908 op/s � js-levenshtein-esm
2,351 op/s � leven
2,381 op/s � levenshtein-edit-distance
2,729 op/s � talisman
License
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
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
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Reason
60 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-gvcj-pfq2-wxj7
- Warn: Project is vulnerable to: GHSA-7fv9-m79r-j9x8
- Warn: Project is vulnerable to: GHSA-4w88-rjj3-x7wp
- Warn: Project is vulnerable to: GHSA-fjqr-fx3f-g4rv
- Warn: Project is vulnerable to: GHSA-6vrv-94jv-crrg
- Warn: Project is vulnerable to: GHSA-f9mq-jph6-9mhm
- Warn: Project is vulnerable to: GHSA-h9jc-284h-533g
- Warn: Project is vulnerable to: GHSA-m93v-9qjc-3g79
- Warn: Project is vulnerable to: GHSA-hvf8-h2qh-37m9
- Warn: Project is vulnerable to: GHSA-mpjm-v997-c4h4
- Warn: Project is vulnerable to: GHSA-3p22-ghq8-v749
- Warn: Project is vulnerable to: GHSA-77xc-hjv8-ww97
- Warn: Project is vulnerable to: GHSA-mq8j-3h7h-p8g7
- Warn: Project is vulnerable to: GHSA-p2jh-44qj-pf2v
- Warn: Project is vulnerable to: GHSA-p7v2-p9m8-qqg7
- Warn: Project is vulnerable to: GHSA-7x97-j373-85x5
- Warn: Project is vulnerable to: GHSA-7m48-wc93-9g85
- Warn: Project is vulnerable to: GHSA-qqvq-6xgj-jw8g
- Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-h726-x36v-rx45
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.9
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More