
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Get free time patches between given time range
const Timeslot = require('jstimeslot');
// Pass 'start' and 'end' in UNIX TIME (Milliseconds)
const maxRange = {
'start': 1483228800000, // Sunday, 1 January 2017 00:00:00:000 GMT
'end': 1483315199999 // Sunday, 1 January 2017 23:59:59:999 GMT
}
const usedSlots = [
{ 'start': 1483232400000, 'end': 1483236000000 }, // 1am - 2am
{ 'start': 1483237800000, 'end': 1483248600000 }, // 2:30am - 5:30am
{ 'start': 1483270200000, 'end': 1483295400000 }, // 11:30am - 6:30pm
];
const manager = new Timeslot(maxRange, usedSlots);
Find free time-slots from the provided max range and used slots
manager.freeSlots
/* [
{ start: 1483228800000, end: 1483232400000 }, // 0am - 1am
{ start: 1483236000000, end: 1483237800000 }, // 2am - 2:30 am
{ start: 1483248600000, end: 1483270200000 }, // 5:30 am - 11-30am
{ start: 1483295400000, end: 1483315199999 } // 6:30 pm - 11:59pm
] */
const additionalUsedSlots = [
{'start': 1483228800000, 'end': 1483232400000 }, // 0am - 1am
{ 'start': 1483236000000, 'end': 1483237900000 } // 2am - 2:31:40am
];
manager.addUsedSlots(additionalUsedSlots);
manager.freeSlots
/* [
{ start: 1483248600000, end: 1483270200000 }, // 5:30 am - 11-30am
{ start: 1483295400000, end: 1483315199999 } // 6:30 pm - 11:59pm
] */
Get free time slots between a time range (must be a subset of max range)
manager.getFreeSlotsBetween({ 'start': 1483237799990, 'end': 1483286400000 }); // 2:29:59 am - 4 pm
/* [
{ start: 1483248600000, end: 1483270200000 }, // 5:30 am - 11-30am
] */
Find overlapping used slots ( returns an array of arrays)
manager.getOverlappingUsedSlots();
/*
[
[
{ start: 1483237800000, end: 1483248600000 }, // 2:30am - 5:30am
{ start: 1483236000000, end: 1483237900000 } // 2am - 2:31:40am
]
]
*/
FAQs
A zero dependency time slot manager
The npm package jstimeslot receives a total of 5 weekly downloads. As such, jstimeslot popularity was classified as not popular.
We found that jstimeslot 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.