
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
minimaximator
Advanced tools
A Node.js package that allows you to get the lowest and the highest number of an array with one function call
A Node.js package that allows you to get the lowest and the highest number of an array with one function call.
Currently, if you have an array of numbers and you want to get the lowest and the highest number you have to:
const nums = [12, 10, 25, 5]
const min = Math.min(nums)
const max = Math.max(nums)
console.log(min, max) // 5 25
...but with this lib, you are able to do:
const { minMax } = require('minimaximator')
const nums = [12, 10, 25, 5]
const [min, max] = minMax(nums)
console.log(min, max) // 5 25
There is benchmark in the benchmark folder that you can run.
Here is a typical example with 100 numbers:
Two calls x 146,444 ops/sec ±1.67% (86 runs sampled)
Minmax function x 5,693,000 ops/sec ±0.64% (90 runs sampled)
Fastest is Minmax function
And here is a typical example with 100000 numbers:
Two calls x 25.93 ops/sec ±7.60% (40 runs sampled)
Minmax function x 9,315 ops/sec ±0.44% (89 runs sampled)
Fastest is Minmax function
FAQs
A Node.js package that allows you to get the lowest and the highest number of an array with one function call
We found that minimaximator 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
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.