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.
nv-facutil-clock
Advanced tools
const {Auto,Manual,Cron} = require("nv-facutil-clock");
var auto = new Auto()
> auto.zone
'+0800'
> auto.str()
'2021-03-05 23:55:04.322 +0800'
> auto.dict()
{
y: 2021,
m: 3,
d: 5,
h: 23,
min: 55,
s: 10,
ms: 853,
ts: 1614959710.853,
mts: 1614959710853,
zone: '+0800',
soffset: 28800,
msoffset: 28800000
}
> auto.sdict()
{
y: '2021',
m: '03',
d: '05',
h: '23',
min: '55',
s: '13',
ms: '961',
ts: 1614959713.961,
mts: 1614959713961,
zone: '+0800',
soffset: 28800,
msoffset: 28800000
}
>
var manual = new Manual()
> manual
Manual [2021-03-05 23:57:06.937 +0800] {}
> manual
Manual [2021-03-05 23:57:06.937 +0800] {}
>
> manual.next_d()
'2021-03-06 23:57:06.937 +0800'
> manual
Manual [2021-03-06 23:57:06.937 +0800] {}
> manual.next_d()
'2021-03-07 23:57:06.937 +0800'
> manual
Manual [2021-03-07 23:57:06.937 +0800] {}
> manual.prev_d()
'2021-03-06 23:57:06.937 +0800'
> manual.prev_d()
'2021-03-05 23:57:06.937 +0800'
>
> manual.next_s()
'2021-03-05 23:57:07.937 +0800'
> manual
Manual [2021-03-05 23:57:07.937 +0800] {}
> manual.prev_s()
'2021-03-05 23:57:06.937 +0800'
> manual
Manual [2021-03-05 23:57:06.937 +0800] {}
>
> manual.prev_ms()
'2021-03-05 23:57:06.936 +0800'
>
> manual.prev_m()
'2021-02-05 23:57:06.936 +0800'
>
> manual.next_y()
'2022-02-05 23:57:06.936 +0800'
> manual.next_y()
'2023-02-05 23:57:06.936 +0800'
>
> manual.next_h(3)
'2023-02-06 02:57:06.936 +0800'
>
var g = manual.nd_gen$$()
> g.next()
{ value: '2021-03-06 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-07 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-08 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-09 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-10 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-11 16:10:37.626 -0000', done: false }
>
var g = manual.nd_gen$$(5)
> g.next()
{ value: '2021-03-16 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-21 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-26 16:10:37.626 -0000', done: false }
>
var g = manual.pd_gen$$(3)
> g.next()
{ value: '2021-03-23 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-20 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-17 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-14 16:10:37.626 -0000', done: false }
> g.next()
{ value: '2021-03-11 16:10:37.626 -0000', done: false }
>
var c =0;
for(let each of manual) {
if(c<10) {
console.log(each)
} else {
break
}
c = c+1
}
/*
2021-03-11 16:13:38.322 -0000
2021-03-11 16:13:38.323 -0000
2021-03-11 16:13:38.324 -0000
2021-03-11 16:13:38.325 -0000
2021-03-11 16:13:38.326 -0000
2021-03-11 16:13:38.327 -0000
2021-03-11 16:13:38.328 -0000
2021-03-11 16:13:38.329 -0000
2021-03-11 16:13:38.330 -0000
2021-03-11 16:13:38.331 -0000
*/
const {Cron} = require("nv-facutil-clock")
var frequency =1000
function task_func(a,b,c) {
console.log(a,b,c,(new Date()).getSeconds())
}
function cond_func(d) {
/*
d = {
y: year,m: month,d: day,
h: hour,min: minutes,s: seconds,ms: ms,
ts: 1614959710.853,
mts: 1614959710853,
}
*/
if(d.s % 7 === 0) {return(true)}
}
var cron = new Cron(frequency,cond_func,task_func,100,200,300)
> cron.launch()
undefined
> 100 200 300 56
100 200 300 0
100 200 300 7
100 200 300 14
()cron.clear100 200 300 21
undefined
> cron.clear()
undefined
>
> var stop_watch = new StopWatch()
undefined
> stop_watch
StopWatch [start_at:undefined duration:undefined end_at:undefined] {}
>
> var p = stop_watch.start()
undefined
> p
Promise {
<pending>,
[Symbol(async_id_symbol)]: 68,
[Symbol(trigger_async_id_symbol)]: 5,
[Symbol(destroyed)]: { destroyed: false }
}
> stop_watch
StopWatch [start_at:1639454327229 duration:7695 end_at:undefined] {}
> stop_watch
StopWatch [start_at:1639454327229 duration:9265 end_at:undefined] {}
> stop_watch
StopWatch [start_at:1639454327229 duration:10850 end_at:undefined] {}
>
> stop_watch
StopWatch [start_at:1639454327229 duration:13856 end_at:undefined] {}
> stop_watch.stop()
{ start_at: 1639454327229, end_at: 1639454350716, costed: 23487 }
>
> p
Promise {
{ start_at: 1639454327229, end_at: 1639454350716, costed: 23487 },
[Symbol(async_id_symbol)]: 68,
[Symbol(trigger_async_id_symbol)]: 5,
[Symbol(destroyed)]: { destroyed: false }
}
> stop_watch
StopWatch [start_at:1639454327229 duration:23487 end_at:1639454350716] {}
>
auto.dict auto.sdict
auto.str auto.zone
manual.dict manual.nd_gen$$ manual.next_d
manual.next_h manual.next_m manual.next_min manual.next_ms
manual.next_s manual.next_w manual.next_y manual.nh_gen$$
manual.nm_gen$$ manual.nmin_gen$$ manual.nms_gen$$ manual.ns_gen$$
manual.ny_gen$$ manual.pd_gen$$ manual.ph_gen$$ manual.pm_gen$$
manual.pmin_gen$$ manual.pms_gen$$ manual.prev_d manual.prev_h
manual.prev_m manual.prev_min manual.prev_ms manual.prev_s
manual.prev_w manual.prev_y manual.ps_gen$$ manual.py_gen$$
manual.sdict manual.str manual.zone
cron.clear cron.cond_func cron.frequency cron.is_running
cron.launch cron.task_func cron.zone
FAQs
clock,date,generator,stream,cron
The npm package nv-facutil-clock receives a total of 1 weekly downloads. As such, nv-facutil-clock popularity was classified as not popular.
We found that nv-facutil-clock demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.