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

spent

v0.1.2

Published

Time tracking for sloths

Downloads

9

Readme

spent

Build Status codecov NPM version

Get it through:

npm i -g spent

How it works?

The CLI lets you get time-stats from almost any text input.

It recognizes the following date-time patterns:

  • +10
  • 01:23
  • 2021-05-10
  • 2021/05/10
  • 05-10-2021
  • 05/10/2021
  • May 10, 2021

Processing rules for parsing:

  • Date patterns are used to group time ranges, also they're required to enable filtering.
  • Time patterns are used as checkpoints, HH:MM values are treated as minutes.
  • Numbers prefixed with + will be summed up as minutes too.

All values MUST be paired, and the first item of each time-slice MUST be in HH:MM format, followed by one-or-more +N or the ending time in HH:MM format.

Usage example

Create a journal.txt file with this contents:

May 10, 2021
  - I reviewed code from 19:00 to 20:22 (+5 +3)

2021-05-09
  - I did some stuff from 13:15 to 16:20

If you run spent - < journal.txt you should get:

2021-05-10, 1:30
2021-05-09, 3:05
Total time spent 4:35

It also works with plain time-slices as arguments:

spent 13:20 15:16

Filtering can be done through --since and --until keywords, e.g.

  • last week equals to 1 week ago
  • yesterday equals to 1 day ago
  • tomorrow equals to next day
  • 1 week ago
  • 90 minutes ago
  • next week
  • next 24 hours

Only minute, hour, day and week keywords are supported.

Use --from to set the date for resolving relative dates, e.g.

spent --from 2021-05-01 --until "next 3 weeks"

Otherwise, the actual date will be used instead.

Motivation

I am used to have a journal file on most projects I work following the Markdown or ToDone formatting rules.

After trying some time-trackers, pomodoro, CLI programs, Android apps, etc. and I'm still unconvinced if they work for me because:

  • Having to switch-context out from my editor just to start/pause/stop a timer is a bummer.
  • Almost surely I'll not start any timer et all, or may I forgot to pause/stop it when switching tasks.
  • I tend to write what's happening rather that "what I'll do", so my journal is not a just ToDo list written in stone.

Those are distractions to me as I found easier (and quicker) to switch between tabs, move around with the keyboard and write down stuff, code or notes, whatever.

Do you think this would work for you too? Just give it a try!