
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
slot-generator
Advanced tools
Generating time slots between a time range
npm install slot-generator --save
or
yarn add slot-generator
const generator = require('slot-generator');
let parm = {
start: '2022-03-12T05:30:00.000Z',
end: '2022-03-18T07:30:00.000Z',
step: 1,
period: 'h',
daysInWeek: [6, 1, 3],
gap: 0,
};
let slots= generator(parm);
console.log(slots);
// output [
// '2022-03-12T05:30:00.000Z',
// '2022-03-12T06:30:00.000Z',
// '2022-03-14T05:30:00.000Z',
// '2022-03-14T06:30:00.000Z',
// '2022-03-16T05:30:00.000Z',
// '2022-03-16T06:30:00.000Z',
// ];
| Key | Type | Value | Default |
|---|---|---|---|
| start | string/Date/moment | '2022-03-12T05:30:00.000Z' | moment() |
| end | string/Date/moment | '2022-03-18T07:30:00.000Z' | moment() |
| step | number | 5 | 5 |
| period | string | 'm'/'h'/'d' | 'm' |
| daysInWeek | Array[number] | [6,1,3] | [1,2,3,4,5,6,7] |
| gap | number | 0 | 0 |
Contributions are welcome. Please submit PRs or just file an Issue if you see something broken or in need of improving.
FAQs
Generating time slots between a time range
We found that slot-generator 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.