
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
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.
Minimal function that tells you whether dates are within the same year, month, day, or hour. Allows subdividing (e.g. 1/2 year).
Minimal function that tells you whether dates are within the same year, month, day, or hour. Allows subdividing (e.g. 1/2 year).
Version 2.0.0 makes the options into an object and adds support for using local vs. UTC comparison
I love moment.js, but for some things (such as date comparison) it's regrettably slow. Until the time comes that it's quick to compare dates in momentjs, this library will come in handy. It's useful for averaging data out over a given time period (i.e. if it's in the same period, average it).
npm install same-date
import sameDate from 'same-date';
const date1 = new Date('2018-06-26');
const date2 = new Date('2018-06-14');
const date3 = new Date('2019-01-01');
const isSameYear = sameDate(date1, date2, 'year'); // true
const isSameYear2 = sameDate(date1, date3, 'year'); // false
const isSameMonth = sameDate(date1, date2, 'month'); // true
const isSameDay = sameDate(date1, date2, 'day'); // false
const isSameHour = sameDate(date1, date2, 'hour'); // false
// Using the section prop, to subdivide the time period for comparison.
const isSameHalfOfMonth = sameDate(date1, date2, 'month', 2); // false, different halves of the month
const isSameThirdOfMonth = sameDate(date1, date2, 'month', 3); // true, same third of the month
// Version 2.0.0+
const isSameLocalDay = sameDate({date: date1, compareDate: date2, unit: 'day', sections: 1, local: true});
FAQs
Minimal function that tells you whether dates are within the same year, month, day, or hour. Allows subdividing (e.g. 1/2 year).
We found that same-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.

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.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.