
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Remembers the highest/lowest values in a data set of any size. Useful if you have a large number of values, but are only interested in the n
highest (or lowest) ones. If you looking for a stream version, check out hifo-stream.
m
of n
values, the time complexity is O(m * n)
.50
, it will only store 50 values in memory.sort
function.Let's assume we have a huge array of people.
var people = [
{ name: 'Alice', age: 23 },
{ name: 'Eve', age: 45 },
{ name: 'Jane', age: 19 },
{ name: 'Bob', age: 30 },
{ name: 'John', age: 60 },
// thousands of others
];
To find the 3 oldest people, we reate a new Hifo
instance and pass the 'age'
as the filter key and 3
as the size.
var hifo = require('hifo');
var oldest = hifo(hifo.highest('age'), 3);
for (var person in people) {
oldest.add(person);
}
oldest.data
will now look like this:
[
{ name: 'John', age: 60 },
{ name: 'Eve', age: 45 },
{ name: 'Bob', age: 30 }
]
Of course you can do this kind of filtering with hifo.lowest
as well.
If you have a question, found a bug or want to propose a feature, have a look at the issues page.
FAQs
Remembers the highest/lowest values in a data set of any size.
The npm package hifo receives a total of 77 weekly downloads. As such, hifo popularity was classified as not popular.
We found that hifo 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.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.