
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Check if a number is equal to 4.
Install the package using npm:
npm install is-four
The is-four package allows you to determine if a number (or other representations of "four") is equal to 4. It also provides methods to check for approximate equality or proximity to 4.
var isFour = require('is-four');
// Exact match
console.log(isFour(4).four()); // true
console.log(isFour(5).four()); // false
// Works with string representations of "four"
console.log(isFour("four").four()); // true
console.log(isFour("cuatro").four()); // true
console.log(isFour("IV").four()); // true
// Works with binary
console.log(isFour(0b100).four()); // true
// Rough equality
console.log(isFour(3.9).roughly.four()); // true
console.log(isFour(4.4).roughly.four()); // true
console.log(isFour(4.6).roughly.four()); // false
// Within 1 of 4
console.log(isFour(3).within(1).of.four()); // true
console.log(isFour(5).within(1).of.four()); // true
console.log(isFour(6).within(1).of.four()); // false
// Within 2 of 4
console.log(isFour(6).within(2).of.four()); // true
console.log(isFour(7).within(2).of.four()); // false
npm test
FAQs
Check if a number is equal to 4.
We found that is-four demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.