Installations
npm install fast-diff
Releases
Unable to fetch releases
Developer
jhchen
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
18.16.0
NPM Version
9.5.1
Statistics
653 Stars
40 Commits
45 Forks
14 Watching
4 Branches
4 Contributors
Updated on 19 Nov 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
2,530,367,304
Last day
-3.6%
3,597,058
Compared to previous day
Last week
4.2%
19,339,983
Compared to previous week
Last month
18.5%
77,322,001
Compared to previous month
Last year
19.5%
768,302,111
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
3
Fast Diff
This is a simplified import of the excellent diff-match-patch library by Neil Fraser into the Node.js environment. The match and patch parts are removed, as well as all the extra diff options. What remains is incredibly fast diffing between two strings.
The diff function is an implementation of "An O(ND) Difference Algorithm and its Variations" (Myers, 1986) with the suggested divide and conquer strategy along with several optimizations Neil added.
1var diff = require('fast-diff'); 2 3var good = 'Good dog'; 4var bad = 'Bad dog'; 5 6var result = diff(good, bad); 7// [[-1, "Goo"], [1, "Ba"], [0, "d dog"]] 8 9// Respect suggested edit location (cursor position), added in v1.1 10diff('aaa', 'aaaa', 1) 11// [[0, "a"], [1, "a"], [0, "aa"]] 12 13// For convenience 14diff.INSERT === 1; 15diff.EQUAL === 0; 16diff.DELETE === -1;
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
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: Apache License 2.0: LICENSE:0
Reason
3 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
Reason
Found 3/23 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
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/jhchen/fast-diff/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/jhchen/fast-diff/test.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:18
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
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 11 are checked with a SAST tool
Score
3.2
/10
Last Scanned on 2024-11-18
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