
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@pinemach/truncate-date
Advanced tools
@pinemach/truncate-date is a small JavaScript package with a single concern: truncating datetime inputs to remove all precision past a given time unit.
You can read the full API documentation at pineapplemachine.github.io/truncate-date-js/.
You can install this package with the package manager of your choice. For example,
npm install @pinemach/truncate-date
You can then import and use the module like so:
const truncateDate = require("@pinemach/truncate-date").truncateDate; // CommonJS
import {truncateDate} from "@pinemach/truncate-date"; // ES6 modules
This package exports the truncateDate function, which accepts a Date object or other time value input and a time unit to truncate that value to.
Truncation occurs in the UTC timezone.
import {truncateDate} from "@pinemach/truncate-date";
const myDate = new Date("2020-04-15T12:30:15.123Z");
// Logs "2020-04-15T12:30:15.000Z"
console.log(truncateDate("second", myDate));
// Logs "2020-04-15T12:00:00.000Z"
console.log(truncateDate("hour", myDate));
// Logs "2020-04-15T00:00:00.000Z"
console.log(truncateDate("day", myDate));
// Logs "2020-01-01T00:00:00.000Z"
console.log(truncateDate("year", myDate));
FAQs
Truncate date values, reducing their precision.
The npm package @pinemach/truncate-date receives a total of 4 weekly downloads. As such, @pinemach/truncate-date popularity was classified as not popular.
We found that @pinemach/truncate-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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.