
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@donutteam/number-utilities
Advanced tools
A collection of various number-related utility functions.
A collection of various number-related utility functions.
Install the package with NPM:
npm install @donutteam/number-utilities
Takes an amount of cents and formats it as an amount of US dollars.
import { centsToUSD } from "@donutteam/number-utilities";
// Returns $43.20
const myDollars = centsToUSD(4320);
Clamps a number between the given minimum and maximums.
import { clamp } from "@donutteam/number-utilities";
// 50
const clamped1 = clamp(127, 25, 50);
// 130
const clamped2 = clamp(127, 130, 150);
// 127
const clamped3 = clamp(127, 25, 150);
Takes an amount of dollars and formats it as an amount of US dollars.
import { dollarsToUSD } from "@donutteam/number-utilities";
// Returns $43.20
const myDollars = dollarsToUSD(43.20);
Generates a random integer between the minimum (inclusive) and the maximum (exclusive) values given to it:
import { randomInt } from "@donutteam/number-utilities";
// Will be some number from 0 to 9
const myRandomInteger = randomInt(0, 10);
Rounds a number to the nearest multiple of the other number.
import { roundToNearestMultiple } from "@donutteam/number-utilities";
// Returns 450
const myRoundedNumber = roundToNearestMultiple(457, 50);
Rounds a number down to the nearest multiple of the other number.
import { roundDownToNearestMultiple } from "@donutteam/number-utilities";
// Returns 450
const myRoundedNumber = roundDownToNearestMultiple(499, 50);
Rounds a number up to the nearest multiple of the other number.
import { roundUpToNearestMultiple } from "@donutteam/number-utilities";
// Returns 500
const myRoundedNumber = roundUpToNearestMultiple(457, 50);
FAQs
A collection of various number-related utility functions.
The npm package @donutteam/number-utilities receives a total of 0 weekly downloads. As such, @donutteam/number-utilities popularity was classified as not popular.
We found that @donutteam/number-utilities 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 malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.