Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clocker

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clocker - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

LICENSE

41

bin/cmd.js

@@ -29,8 +29,3 @@ #!/usr/bin/env node

var type = argv.type;
var pkey = strftime('time!%F %T', d);
var tkey = 'time-type!' + type + '!' + strftime('%F %T', d);
db.batch([
{ type: 'put', key: pkey, value: { type: type, message: message } },
{ type: 'put', key: tkey, value: 0 }
], error);
start(d, message, type, error);
}

@@ -44,3 +39,3 @@ else if (argv._[0] === 'stop') {

if (err) error(err)
else onrow({ key: key, value: value })
else onrowstop({ key: key, value: value })
});

@@ -52,5 +47,5 @@ }

limit: 1, reverse: true
}).once('data', onrow);
}).once('data', onrowstop);
}
function onrow (row) {
function onrowstop (row) {
var m = argv.message;

@@ -65,2 +60,21 @@ if (m) {

}
else if (argv._[0] === 'restart') {
var k = argv.key || argv._[1];
if (k) {
db.get(getKey(k), function (err, value) {
if (err) error(err);
else onrowrestart({ value: value });
});
}
else {
db.createReadStream({
gt: 'time!', lt: 'time!~',
limit: 1, reverse: true
}).once('data', onrowrestart);
}
function onrowrestart (row) {
start(new Date, row.value.message, row.value.type, error);
}
}
else if (argv._[0] === 'add' && argv._.length === 3) {

@@ -272,2 +286,11 @@ var start = strftime('%F %T', new Date(argv._[1]));

function start (date, message, type, cb) {
var pkey = strftime('time!%F %T', d);
var tkey = 'time-type!' + type + '!' + strftime('%F %T', d);
db.batch([
{ type: 'put', key: pkey, value: { type: type, message: message } },
{ type: 'put', key: tkey, value: 0 }
], cb);
}
function edit (src, cb) {

@@ -274,0 +297,0 @@ var file = path.join(tmpdir, 'clocker-' + Math.random());

@@ -9,2 +9,5 @@ usage:

clocker restart [STAMP]
Restart either last clock or clock at STAMP.
clocker status

@@ -11,0 +14,0 @@ Show the elapsed time if the clock is active or "stopped".

{
"name": "clocker",
"version": "1.4.0",
"version": "1.5.0",
"description": "track project hours",

@@ -5,0 +5,0 @@ "bin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc