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

teeny-logger

v1.0.0

Published

A tiny console logger for nodejs CLI apps

Downloads

70

Readme

Teeny Logger

npm David David GitHub Workflow Status

Teeny Logger is a dead-simple console logger for nodejs command-line applications.

Installation

> cd your-project
> npm install --save-dev teeny-logger

Usage

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger();

log.info("this is an informational log");
log.warn("this is a warning log");
log.error("this is an error log");

API

Methods

Teeny Logger relies on console behind the scenes, and therefore supports the same string substitution capabilities and uses the following methods:

| Method | Description | Output color | | ------ | --------------------------------------------------------- | ------------ | | debug | Outputs a message to the console with the log level debug | grey | | log | For general output of logging information. | white | | info | Informative logging of information. | blue | | warn | Outputs a message to the console with the log level debug | yellow | | error | Outputs an error message. | red |

Options

Disabling logging

You can disable logging with silent:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger();

log.info("this will be logged");
// disabling logs in production for example
log.silent = process.env.NODE_ENV === "production";
log.info("but this will not");
log.silent = false;
log.info("this will be logged again!");

This option can also be passed to the constructor:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger({ silent: true });

log.info("this will not be logged");
log.silent = false;
log.info("this will be logged again!");

Disabling colors

You can disable colors with boring:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger();

log.info("this will be logged in the default [info] color");
// disabling colors in test mode for example
log.boring = process.env.NODE_ENV === "test";
log.info("but this will not have any colors :/");
log.boring = false;
log.info("colors are back!");

This option can also be passed to the constructor:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger({ boring: true });

log.info("this will not be logged in color");
log.boring = false;
log.info("this will be logged again!");

Adding a prefix

You can add a prefix to the logs with prefix:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger();

log.info("this will be logged with no prefix");
log.prefix = "[INFO]";
log.info("this will have a prefix!");

The output of that last line would be:

> [INFO] this will have a prefix!

This option can also be passed to the constructor:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger({ prefix: "Log:" });

log.info("this will be logged with a prefix");
log.prefix = false;
log.info("this will be NOT be logged with a prefix");

Adding a local timestamp

You can add a timestamp to the logs with timestamp:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger();

log.info("this will be logged with no timestamp");
log.timestamp = true;
log.info("this will have a timestamp!");

The output of that last line would look like:

> [ Tue Feb 02 2021 8:32:58 PM ] this will have a timestamp!

This option can also be passed to the constructor:

const TeenyLogger = require("teeny-logger");
const log = new TeenyLogger({ timestamp: true });

log.info("this will be logged with a timestamp");
log.timestamp = false;
log.info("this will be NOT be logged with a timestamp");

License

MIT © Arno Versini