Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Used to create simple tied ranks.
var Rank = require('datarank')
// Sample data
var data = [
{id: 'a', value: 1},
{id: 'b', value: 2},
{id: 'c', value: 2},
{id: 'd', value: 2},
{id: 'e', value: 3}
]
// Examples
Rank(data, 'value').rank().normalize().value()
// { data: (sorted data), rank: [0, .25, .5, .75, 1] }
Rank(data, 'value').rank().value()
// { data: (sorted data), rank: [0, 1, 2, 3, 4] }
Rank(data, 'value').tiedRank().normalize().value()
// { data: (sorted data), rank: [0, .5, .5, .5, 1] }
Rank(data, 'value').tiedRank().value()
// { data: (sorted data), rank: [0, 2, 2, 2, 4] }
Rank(data, 'value').tiedRank().value('merged')
// [{id: 'a', value: 1, rank: 0}, {id: 'b', value: 2, rank: 2}, ... ]
##Usage ####Rank(data, key, [direction]) Creates a new ranking object
data
- an array of objectskey
- the key to sort ondirection
(optional) - -1 will invert the sort####.rank() Perform a simple ranking
####.tiedRank() Average out rank of ties
####.normalize() Normalize ranks from 0 to 1
####.value([format]) Return the ranking
format
(optional) - 'merged' will add the ranking to the data rows under the rank keyFAQs
datarank ========
We found that datarank 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.