Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@date/generator
Advanced tools
Generate dates with readable function chaining.
Also has functions accepting numbers to help with using values provided from elsewhere.
npm install @date/generator --save
var gen = require('@date/generator')
// these are equivalent:
// specify each thing individually
var washingtonDay = gen.third().monday().in().january().of(2016)
// skip the in() and of() and specify the year in the january() call
var washingtonDay = gen.third().monday().january(2016)
// specify 'third' with a '3' to monday(),
// january with '0' to month()
var washingtonDay = gen.monday(3).month(0).of(2016)
var thanksgiving = gen.fourth().thursday().in().november().of(2016)
Start with the order functions:
first()
- 1second()
- 2third()
- 3fourth()
- 4last()
- 5 (will be last, even when last is the fourth)Day functions are available after calling an order function, or, start with them and specify the order value as 1-5:
sunday()
monday()
tuesday()
wednesday()
thursday()
friday()
saturday()
Month functions are available after calling a day function:
january()
february()
march()
april()
may()
june()
july()
august()
september()
october()
november()
december()
Also, shortcut making a call to of(year)
after it and specify the year in the month call, like august(2016)
.
Last call specifies the year to function of(year)
and returns a Date instance.
FAQs
Calculate dates with easy to read helper functions
The npm package @date/generator receives a total of 1,350 weekly downloads. As such, @date/generator popularity was classified as popular.
We found that @date/generator 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.