
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
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 30 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.