Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ranged-date
Advanced tools
Converts a given string, number, or Date object to the number of milliseconds since the Unix epoch, provided that it can be recognized as millisecond, second, or microsecond time within a specified range from the current date.
Converts a given string, number, or Date object to the number of milliseconds since the Unix epoch, provided that it can be recognized as millisecond, second, or microsecond time within a specified range from the current date.
Milliseconds, seconds, or microseconds may be excluded as possibilities for range matching.
Useful for:
MIGRATION NOTICE:
Node.JS version 6.0.0 or above.
npm i ranged-date
The following commands will test the package for errors.
cd /path/to/node_modules/ranged-date
npm test
Converts a given string, number, or Date object to the number of milliseconds since the Unix epoch, provided that it can be recognized as millisecond, second, or microsecond time within a specified range from the current date.
data
(Date | number | string) Data to attempt to recognize as valid date.yrBack
number Years before current date as lower bound.yrFwd
number Years after current date as upper bound.exclusions
Object Specifies interpretation exclusions, if any.
// All return current time in ms
rangedDate(new Date(), 1, 1)
rangedDate(Date.now(), 1, 1)
rangedDate(new Date().toString(), 1, 1)
rangedDate(String(Date.now()), 1, 1)
// All return false
rangedDate(Date.now() - 10000000, 0.0000001, 0.0000001)
rangedDate(Date.now(), 1, 1, {ms: true})
// All throw cert-is TypeAssertionErrors
rangedDate()
rangedDate(new Date())
rangedDate({})
rangedDate(328385)
// Throws cert-is RangeAssertionError
rangedDate(Date.now(), -1, -1)
Returns (number | boolean) Converted time in ms or false if outside range.
Versioning using SemVer. For available versions, see the tags on this repository.
This project is licensed under the ISC License - see the LICENSE.md file for details
<a name="2.0.1"></a> 2.0.1 (2019-06-13)
| Changes since 2.0.0 | Release Notes | README | | --- | --- | --- |
| Source Code (zip) | Source Code (tar.gz) | | --- | --- |
Bugfixes:
FAQs
Converts a given string, number, or Date object to the number of milliseconds since the Unix epoch, provided that it can be recognized as millisecond, second, or microsecond time within a specified range from the current date.
The npm package ranged-date receives a total of 4 weekly downloads. As such, ranged-date popularity was classified as not popular.
We found that ranged-date 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.