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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@haldami/habits-cli

v0.1.0

Published

Tiny CLI to stamp habit completions into a CSV file and print a monthly calendar.

Readme

habits-cli

Two tiny commands for tracking a habit in a plain CSV file. Written in TypeScript (strict), compiled to plain JavaScript, no runtime dependencies, Node >= 18.

  • habits-stamp <csv_file> appends the current local time as yyyy-mm-ddThh:mm.
  • habits-print [<year> <month>] <csv_file> prints a Markdown calendar of the month; days with a stamp are marked with *.
$ habits-stamp habit.csv
$ habits-print 2026 6 habit.csv
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| --- | --- | --- | --- | --- | --- | --- |
|  01 |  02 |  03 |  04 |  05 |  06 |  07 |
...
|  22 |  23 |  24 | *25 |  26 |  27 |  28 |
|  29 |  30 |     |     |     |     |     |

Develop

pnpm install
pnpm typecheck      # tsc, strict + noUncheckedIndexedAccess
pnpm test           # vitest
pnpm build          # tsc -> dist/
node dist/cli/print.js 2026 6 habits/habit.csv
pnpm link --global  # exposes habits-stamp and habits-print for local testing

Layout:

src/habits.ts        logic (pure functions + file helpers)
src/habits.test.ts   tests
src/cli/stamp.ts     habits-stamp entry point
src/cli/print.ts     habits-print entry point
dist/                build output, git-ignored, the only thing that gets published

tsconfig.json is for typechecking (including tests, no emit); tsconfig.build.json emits dist/ without the tests.

Publish as an npm package

Publishing a TypeScript package is the same as publishing a JavaScript one, except that you publish the compiled dist/, not src/. This is already wired up: package.json has bin pointing into dist/, files: ["dist"], and a prepublishOnly script that runs typecheck, tests and build, so a stale or missing dist/ can't be published. The bin sources start with #!/usr/bin/env node, which tsc preserves; npm makes the bin files executable on install.

  1. Pick the name. habits-cli is already taken on npm, so the package is scoped: @haldami/habits-cli. Use your own npm username/org as the scope and check it is free: npm view @<scope>/habits-cli should return 404.
  2. Log in: npm login (check with npm whoami). Enable 2FA on the account.
  3. Check the tarball:
    pnpm typecheck && pnpm test && pnpm build
    pnpm pack --dry-run   # should list only dist/, package.json, README.md
  4. Try it locally from the tarball, the way users will get it:
    pnpm pack
    npx --package ./haldami-habits-cli-0.1.0.tgz habits-print habits/habit.csv
    Delete the .tgz afterwards.
  5. Publish. Scoped packages are private by default, so pass --access public:
    pnpm publish --access public
    prepublishOnly rebuilds first. Publishing is effectively permanent: a version can't be reused, and unpublishing is restricted.
  6. Use it:
    npm i -g @haldami/habits-cli
    # or without installing (the package has two bins, so name the one to run):
    npx -p @haldami/habits-cli habits-print habit.csv

Releasing later

pnpm version patch   # or minor / major: bumps package.json, commits, tags
pnpm publish
git push --follow-tags

Before the first release consider adding repository, author and a LICENSE file (package.json already says MIT, but no license text is in the repo yet).