DEV Community

Cover image for I finally published a side project I wrote 4 years ago
Yash Datir
Yash Datir

Posted on

I finally published a side project I wrote 4 years ago

In 2021, I was building a Node.js CLI tool and got frustrated with how bare console.log looks when you're trying to give users meaningful output. So I wrote a small utility class — some ANSI escape codes, a colored log wrapper, a basic spinner. Enough to get the job done.

I used it across a couple of projects. It lived in a local utils/ folder, copy-pasted from repo to repo. I kept telling myself I'd clean it up and put it on npm. That was four years ago.


What took so long

Honestly? Nothing dramatic. Life, other projects, the usual inertia. The code worked well enough that I never had to revisit it, so I never did. There was also a part of me that felt like it was too small to bother publishing. Who needs another npm package?

But I kept using it. And every time I copy-pasted it into a new project, I thought — I really should just put this on npm.

So I finally did.


What's in it

budgie-console is a lightweight, zero-dependency Node.js console utility. Here's what it covers:

Colored and styled output

const Console = require('budgie-console');

Console.log(Console.FgGreen, 'Build complete');
Console.log(Console.Bright + Console.FgRed, 'Critical error');
Enter fullscreen mode Exit fullscreen mode

Semantic log levels

Console.success('Server started');
Console.error('Connection failed');
Console.warn('Rate limit approaching');
Console.info('Running Node ' + process.version);
Enter fullscreen mode Exit fullscreen mode

Spinner

let running = true;
Console.spinner(['','','','','','','','','',''], 'Loading...', 80, () => running);
setTimeout(() => { running = false; }, 3000);
Enter fullscreen mode Exit fullscreen mode

Progress bar

let i = 0;
const iv = setInterval(() => {
  Console.progress(i, 50);
  if (++i > 50) clearInterval(iv);
}, 40);
Enter fullscreen mode Exit fullscreen mode

Table

Console.table(
  [['Alice', 28, 'Engineer'], ['Bob', 34, 'Designer']],
  ['Name', 'Age', 'Role']
);
Enter fullscreen mode Exit fullscreen mode

Box, divider, prompt, clear — all in there too.


What I cleaned up

The original code had a bug I'd never noticed until I sat down to review it properly. The spinner method used a regular function inside setInterval, which meant this wasn't bound correctly — it was referencing the wrong context for this.Reset. It worked most of the time because the fallback was just an empty string, but it was wrong. Switching to an arrow function fixed it.

I also rewrote the default spinner frames from ['-', '+'] to a proper braille animation, tightened up the formatting, and added the new methods that were missing from the original.


Install

npm install budgie-console
Enter fullscreen mode Exit fullscreen mode

It's a small package. If you write Node scripts or CLI tools and want cleaner output without pulling in a heavy dependency, it might be useful.

And if you have something sitting in a local utils/ folder that you've been meaning to publish — maybe this is the nudge.

Top comments (2)

Collapse
 
ai_made_tools profile image
Joske Vermeulen

I like that you actually came back to finish it after 4 years, that’s more rare than the idea itself.

Curious: what made you finally push it live now?

Collapse
 
yashdatir profile image
Yash Datir

Honestly, there wasn't a big moment. I just opened an old repo for reference one evening and the file was right there. Started reading it, found the bug, fixed it — and somewhere in that hour I thought, if I close this without shipping it I'm just going to be back here in another four years.

Sometimes the only thing that changes is you stop waiting for the right reason.