
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
leven-sort
Advanced tools
Simply sort by similarity, starring Levenshtein via leven.
Allows sorting of an array of strings or array of objects by similarity. For arrays of objects you can sort by up to two keys.
npm i leven-sort --save
leven-sort only exports one function, but it has 3 distinct signatures
Sort simple text array
arrayToSort: Array to sort (sorted in place)
sourceText: The text to check similarity of
Sort array of objects, with optional secondary sort
arrayToSort: Array to sort (sorted in place)
sourceText1: The text to check similarity of
key1: Property name to be compared in each object
sourceText2 (optional): If performing a secondary sort, this is the text to check key2 by
key2 (optional): For secondary sort on object, this is the second property to check
Sort array of objects by multiple keys, each by the same source and with equal weight
arrayToSort: Array to sort (sorted in place)
sourceText: The text to check similarity of
arrayOfKeys: Array of property names to compare
Sort simple text array
const levenSort = require('leven-sort')
const sourceName = 'Bill Griffin'
const nameAry = [
'Carl Martinez',
'Roger Davis',
'William George',
'Andrew Torres',
'Billy Campbell',
'Alan King',
'Benjamin Wilson',
'Bill Griffin',
'Dennis Smith',
'Billy Griffith'
]
let levSorted = levenSort(nameAry, sourceName)
Sort array of objects, with secondary sort
const levenSort = require('leven-sort')
const sourceFirst = 'Bill'
const sourceLast = 'Griffin'
const nameObjAry = [
{ first: 'Carl', last: 'Martinez' },
{ first: 'Roger', last: 'Davis' },
{ first: 'William', last: 'George' },
{ first: 'Andrew', last: 'Torres' },
{ first: 'Billy', last: 'Campbell' },
{ first: 'Alan', last: 'King' },
{ first: 'Benjamin', last: 'Wilson' },
{ first: 'Bill', last: 'Griffin' },
{ first: 'Dennis', last: 'Smith' },
{ first: 'Billy', last: 'Griffith' }
]
let levSorted = levenSort(nameObjAry, sourceFirst, 'first', sourceLast, 'last')
Sort array of objects by multiple keys
const levenSort = require('leven-sort')
const source = 'Bill'
const nameObjAry = [
{ first: 'Carl', last: 'Martinez' },
{ first: 'Roger', last: 'Davis' },
{ first: 'William', last: 'George' },
{ first: 'Andrew', last: 'Torres' },
{ first: 'Billy', last: 'Campbell' },
{ first: 'Alan', last: 'King' },
{ first: 'Benjamin', last: 'Wilson' },
{ first: 'Bill', last: 'Griffin' },
{ first: 'Dennis', last: 'Smith' },
{ first: 'Billy', last: 'Griffith' }
]
let levSorted = levenSort(nameObjAry, source, ['first', 'last'])
FAQs
Simply sort by similarity, starring Levenshtein via leven
We found that leven-sort demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.