
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Check if a number is in your min-max bounds.
npm install btwn
...or...
yarn add btwn
var btwn = require('btwn');
var x = 12; // a normal Number type variable
if(x.btwn(1, 13)){
console.log("This number is under or equals to 13, and greater than or equals to 1.");
} else {
console.log("This number is under 1 or greater than 13.");
}
var btwn = require('btwn');
// Bounds are 09:00-09:59 (inclusive)
var minDate = new Date(2017, 00, 01, 09, 00, 00, 00);
var maxDate = new Date(2017, 00, 01, 09, 59, 59, 00);
var min = new btwn.BoundDate(minDate, false, false, false, true, true, false, false); //See the usage of these booleans in the docs below
var max = new btwn.BoundDate(maxDate, false, false, false, true, true, true, false); //See the usage of these booleans in the docs below
var d = new Date(); //Current date & time
if(d.btwn(min, max)){
console.log("It's after 8:59:59 and before 10:00:00!");
} else {
console.log("It's before 9:00:00 or after 9:59:59.");
}
Download the latest btwn.js
from here, and follow the instructions above without the require
line.
Run mocha
.
FAQs
Check if a number or date is in your min-max bounds.
We found that btwn 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.