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

misty

v1.6.10

Published

Logging utils for command line

Readme

misty

npm Code style: Prettier Donate

Logging utils for command line

 

Example

Clone misty and run the test.js script.

git clone https://github.com/alloc/misty
node misty/test.js

 

Usage

import {
  isInteractive,
  warn,
  warnOnce,
  fatal,
  success,
  clear,
  print,
} from 'misty'

if (isInteractive) {
  // Prompt the user or something.
}

// Print a yellow message with [!] in front.
warn('Be careful')

// Like `warn` but messages are deduplicated.
warnOnce('Deprecated: Use foo instead')

// Print a message to stderr with red [!] in front. Then call process.exit(1)
fatal('Bollocks')

// Print a message with green checkmark in front.
success('We did it!')

// Clear the screen and scrollback.
clear()

// Clear two lines above the cursor.
clear(2)

// Like console.log without a line break. Useful for control sequences.
print('...')

 

Tasks

The misty/task module provides the startTask function, which helps you communicate what your script is doing without spamming the final output. Task logs are transient, so it's best to avoid using tasks for information that could be useful for debugging.

Tasks are logs that:

  • have a spinner in front
  • stick to the end
  • can be updated
  • can be finished
  • print their elapsed time
import { startTask } from 'misty/task'

const task = startTask('Building…')
task.update('Analyzing…')
task.finish('Build completed')

What else should you know?

  • Multiple tasks can be active at once.
  • Call finish with no message to hide the task.

 

Spinner

The misty/spin module provides functions to customize the spinner and build your own task-like messages.

import { setSpinner } from 'misty/spin'

// Customize the spinner!
setSpinner({
  interval: 50,
  frames: ['◐', '◓', '◑', '◒'],
  color: require('kleur').magenta,
})

// These are for advanced usage.
import { spin, spinListeners, getSpinner } from 'misty/spin'

What else should you know?

  • Animating multiple different spinners is not supported.
  • Tasks use the spinner passed to setSpinner.

 

Prompts

Prompts are not supported by misty, but I recommend these packages:

 

Colors

Color support is provided by kleur, so you should use that too.

 

Logging

Logs are handled by shared-log.