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 🙏

© 2025 – Pkg Stats / Ryan Hefner

graceful-logger

v0.4.3

Published

A simple, slim, graceful logger for Nodejs

Downloads

60

Readme

Graceful-Logger

A simple, slim, graceful logger for Nodejs

build status

Capture

capture

Example

logger = require('../lib')

logger.info('Hello', 'World!')
logger.warn({a: 'a', b: 'b'})
logger.err(-> "This is a function")

logger.format('medium')

logger.info('Hello', 'World!')
logger.warn({a: 'a', b: 'b'})
logger.err(-> "This is a function")

# Other features
## Output multi lines
logger.info '''
This is a multi line message:
Hello everyone.
Have a nice day!
'''

## Output required package
logger.info require('path')

## Output empty message
logger.info()

## Define any colors
logger.format ':level.blue :msg.grey'
logger.info('hello world')

## Use the numeric placeholder
logger.format ':level :0.grey :1.blue'
logger.info('hello', 'world')

Benchmark

Console x 5,367 ops/sec ±2.96% (89 runs sampled)  # console.log
Log x 5,556 ops/sec ±1.76% (93 runs sampled)      # The tiny log module written by tj
Logger x 5,612 ops/sec ±0.95% (96 runs sampled)   # This module
Fastest is Logger,Log,Console

ChangeLog

0.4.0

  1. Remove multi-line prefix (v0.3.1) for the sake of efficiency
  2. User can define any color of the message by .(color) format, but it only works after the :(label) expression, e.g. :level.green :msg.grey
  3. The :msg flag now support numbers for express the message of the correct index, e.g. :1.green :2.grey, and you will get an green 'hello' and a grey 'world' by using logger.info('hello', 'world'). Remember, the index start from 0.

0.3.2

  1. User can redefine color and level prefix by set the color and level property of each method.

0.3.1

  1. Add prefix to each line when messages have multi lines.

0.3.0

  1. Write message to process.stdout or process.stderr stream
  2. Use util.format to format object/function/array etc, as the same of console.log
  3. Add setStream and getStream to get/set writable stream of each method
  4. Add error as alias of err, warning as alias of warn

0.2.1

  1. Move exit feature from logger.err to logger.exit

0.2.0

  1. Use meanful tags such as :date, :level, etc...
  2. Remove custom prefix
  3. Use JSON.stringify to output objects

License

MIT