
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
peak-finding
Advanced tools
Find an element in an array where the element peaks.
In the One-Dimensional version an element is a peak if this element is larger or equal to both the elements on its sides.
In the Two-Dimensional version an element is a peak if this element is larger or equal to all the elements on its sides (North, south, west and east sides).
$ npm install --save peak-finding
var peakFinding = require('peak-finding');
peakFinding([1, 3, 4, 3, 5, 1, 3]);
//=> 4
peakFinding([[23, 20, 19, 10],
[14, 10, 12, 11],
[15, 9, 11, 21],
[16, 11, 10, 17]]);
//=> 23
1D Version: Θ(log2(n)), where n is the length of the input list.
2D Version: Θ(n * log2(m)) or Θ(n * log2(n)) if n = m, where n is the number of columns and m the number of rows.
Required
Type: Array
MIT © Vinícius do Carmo
FAQs
Find a peak element in an array list.
We found that peak-finding 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 Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

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.