
Security News
OpenClaw Skill Marketplace Emerges as Active Malware Vector
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.
nearest-date
Advanced tools
Given an array of dates, this module will find the date nearest to a given target date. Can be used to find the nearest number as well
Given an array of dates, this module will find the date nearest to a given target date. Can be used to find the nearest number as well.
npm install nearest-date
var nearest = require('nearest-date')
var dates = [
new Date('2012-12-12'),
new Date('2024-12-12'),
new Date('2022-12-12'),
new Date('2016-12-12'),
new Date('1980-12-12'),
]
var target = new Date('2016-12-27')
var index = nearest(dates, target)
console.log('Winner:', dates[index])
index = nearest(array[, target])Finds the value in the array nearest to the target and returns the
index of that value in the array.
The target defaults to Date.now().
Both the array and the target can be either Date objects or
numbers.
MIT
FAQs
Given an array of dates, this module will find the date nearest to a given target date. Can be used to find the nearest number as well
The npm package nearest-date receives a total of 529 weekly downloads. As such, nearest-date popularity was classified as not popular.
We found that nearest-date 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 researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.