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

@choksheak/timecli

v1.0.3

Published

Prefix to a CLI command to print out the time taken.

Downloads

10

Readme

timecli ⏱️

A super tiny and simple CLI utility to time the execution of another CLI command. Written in Javascript to minimize the number of dependencies (e.g. Golang, Rust etc.) to your package. The execution time overhead to your script is likely less than 0.1 seconds, which should be negligible in most cases.

How to install

Most likely you will need this for local development only.

npm i -D @choksheak/timecli

Why do you need this?

I searched around (Dec 2020) and was unable to find any npm package that serves the same purpose. The closest match is gnomon, but the output is too heavy and it loses all console colors from the original output.

Some reasons why you want to install this package:

  1. Cross-platform portability - no need to worry about using platform-specific timer executables.
  2. Tiny in size - There are a few minimally-needed dependencies, but they are also tiny.
  3. Uses pure Node + Javascript only - no need to deal with potential antivirus warnings from running .exe files.
  4. Fast - takes 0.1 seconds or less to run.
  5. Simple - Outputs a one-liner at the end of the run, showing the time clearly.
  6. Convenient - Able to run any command from your PATH environment variable or in your local node_modules/.bin directory.
  7. Non-intrusive - Just prepend any command with timecli in your package.json to time the task everytime you run it!
  8. Fun! - console output is colored!

Usage

> npx timecli
[timecli] Usage: npx timecli [command] <arguments> ...

Examples

Test script

> npx timecli node test.js

[test.js] Test script: Yellow Cyan Green Red

[timecli] Took 0.082s. [Exit code = 0]

Sleep

> npx timecli sleep 10

[timecli] Took 10.688s. [Exit code = 0]

Over one minute

> npx timecli sleep 70

[timecli] Took 1m 12s (72.517s). [Exit code = 0]

Related tool

If you want a native CLI tool that does pretty much the same thing, you can download timeit from https://github.com/choksheak/timeit which is written in Golang.

Enjoy!

Hope you have fun using this script! 😄