Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ddf-time-utils
Advanced tools
npm i ddf-time-utils
ddf-time-utils
is created for DDF time format checking and manipulation.
These constants describes five different kinds of time supported by DDF.
More info - in Examples
section.
const ddfTimeUtils = require('ddf-time-utils');
const resultYear = ddfTimeUtils.detectTimeType('2000');
const resultQuarter = ddfTimeUtils.detectTimeType('2000q1');
const resultMonth = ddfTimeUtils.detectTimeType('200001');
const resultWeek = ddfTimeUtils.detectTimeType('2000w01');
const resultDate = ddfTimeUtils.detectTimeType('2000102');
console.log(resultYear === ddfTimeUtils.YEAR_TYPE);
console.log(resultQuarter === ddfTimeUtils.QUARTER_TYPE);
console.log(resultMonth === ddfTimeUtils.MONTH_TYPE);
console.log(resultWeek === ddfTimeUtils.WEEK_TYPE);
console.log(resultDate === ddfTimeUtils.DATE_TYPE);
const ddfTimeUtils = require('ddf-time-utils');
const result = ddfTimeUtils.detectTimeType('200x0102');
console.log(result === null);
const ddfTimeUtils = require('ddf-time-utils');
const simpleResult = ddfTimeUtils.getTimeRange(['1990']);
const multipleResult = ddfTimeUtils.getTimeRange(['1800', ['2013', '2015'], '2017', '980']);
console.log(simpleResult);
console.log(multipleResult);
Result:
[ '1990' ]
[ '1800', '2013', '2014', '2015', '2017', '980' ]
const ddfTimeUtils = require('ddf-time-utils');
const result = ddfTimeUtils.getTimeRange([['1990q1', '1992q2'], '1993q4']);
console.log(result);
Result:
[ '1990q1',
'1990q2',
'1990q3',
'1990q4',
'1991q1',
'1991q2',
'1991q3',
'1991q4',
'1992q1',
'1992q2',
'1993q4' ]
const ddfTimeUtils = require('ddf-time-utils');
// time range detection is possible only for same kind of time
// we have `year` and `quarter` types in same query
const result = ddfTimeUtils.getTimeRange(['2015', '2011q1']);
console.log(result);
Result:
null
const ddfTimeUtils = require('ddf-time-utils');
// unexpected time
const result = ddfTimeUtils.getTimeRange(['foo']);
console.log(result);
Result:
null
FAQs
Gapminder DDF time utils
We found that ddf-time-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.