npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

clocker

v1.25.0

Published

track project hours

Downloads

129

Readme

clocker

track project hours

clocker

example

To start tracking hours, just do clocker start:

$ clocker start -t BAZCORP

The -t is optional.

Some hours pass, then:

$ clocker stop

Run clocker start and clocker stop as you have more hours to track.

You can list the hours you've racked up with clocker list:

$ clocker list
1392707136  2014-02-17  [ 23:05:36 - 02:15:00 ]  (03:09:24)  [BAZCORP]
1392751800  2014-02-18  [ 11:30:00 - 16:20:00 ]  (04:50:00)  [BAZCORP]
1393020600  2014-02-21  [ 14:10:00 - 18:32:00 ]  (04:22:00)  [BAZCORP]

You can see a report of all logged hours of a specific day with clocker report command:

$ clocker report --day 2018-05-23
Report for 23 May 2018:
1527053106  2018-05-23  [ 07:25:06 - 08:09:25 ]  (00:44:19)  [TYPE_A]
1527056838  2018-05-23  [ 08:27:18 - 11:30:00 ]  (03:02:42)  [TYPE_B]
1527067800  2018-05-23  [ 11:30:00 - 11:58:18 ]  (00:28:18)  [TYPE_C]
1527073296  2018-05-23  [ 13:01:36 - 16:31:54 ]  (03:30:18)  [TYPE_B]

TYPE_A: 00:44:19
TYPE_B: 06:33:00
TYPE_C: 00:28:18

total: 07:45:37

Without the --day option, the report command will list all logged hours of the current day.

You can generate a json dump with clocker data:

$ clocker data BAZCORP --rate 125
[
  {
    "title": "consulting",
    "rate": 125,
    "hours": [
      {
        "date": "2014-02-18",
        "hours": 7.1
      },
      {
        "date": "2014-02-17",
        "hours": 0.9
      },
      {
        "date": "2014-02-21",
        "hours": 4.4
      }
    ]
  }
]

This json output can be fed into invoicer to generate a PDF invoice:

$ clocker data BAZCORP --rate 125 | invoicer -r BAZCORP -o invoice.pdf

usage

usage:

  clocker start {-t TYPE, -m MESSAGE} [-- DATA]
    Start the clock. Optionally give a TYPE and MESSAGE.
    Optionally set additional DATA in the format --KEY=VALUE.

  clocker stop {-m MESSAGE} [STAMP]
    Stop the clock.

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

  clocker status
    Show the elapsed time if the clock is active or "stopped".

  clocker data {-t TYPE, -r RATE, --title TITLE, --gt DATE, --lt DATE, -a}
    Generate invoicer-compatible json output.
    Show dates between lt and gt. Show archived dates with -a.
    Optionally filter by TYPE, a string or /regex/.

  clocker list {-v, --gt DATE, --lt DATE, -a, -t TYPE}
    Show hourly data with STAMPS on the leftmost column.
    In verbose mode (-v), also show clocked messages.
    Show dates between lt and gt. Show archived dates with -a.
    Optionally filter by TYPE, a string or /regex/.

  clocker report {-v, --day DATE}
    Show all logged hours of a specific day.
    In verbose mode (-v), also show clocked messages.
    If no --day is set, the current day will be used.

  clocker csv {--gt DATE, --lt DATE, --props FIELDS, -a}
    Generate CSV output.
    Show dates between lt and gt. Show archived dates with -a.
    Additionally display the properties FIELDS.

  clocker add START END {-t TYPE, -m MESSAGE}
    Add a hours from START to END as date strings.

  clocker get STAMP
    Get the data at STAMP.

  clocker rm STAMP...
    Remove the data at STAMP.

  clocker set [STAMP] KEY VALUE
    Adjust time stamp boundaries or other properties of either last clock
    or clock at STAMP.
    Time stamp boundaries are parsed, like '20:11' or '10 minutes ago'.

  clocker edit STAMP {KEY}
    Launch $EDITOR to edit the record at STAMP.
    Optionally edit a single KEY.

  clocker move [STAMP] START
    Move the data at STAMP to the new START, maintaining the elapsed time.

  clocker archive {--lt=DATE, --gt=DATE}
  clocker archive [STAMP...]
    Archive a range of clocked records or a list of STAMPs.
 
  clocker unarchive {--lt=DATE, --gt=DATE}
  clocker unarchive [STAMP...]
    Un-archive a range of clocked records or a list of STAMPs.

install

With npm do:

npm install -g clocker

to get the clocker command.

license

MIT