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

@jikurata/logger

v1.0.1

Published

Expanded console logging

Readme

Logger v1.0.1

Expanded console logging

Install

npm install @jikurata/logger

Basic Usage

const Logger = require('@jikurata/logger');

// Prints message with a timestamp
Logger.log('foo'); // [<Timestamp>] foo

// Timestamp can be disabled
Logger.showTimestamp = false;
Logger.log('foo') // foo

// Disable logging
Logger.printMessage = false;
Logger.log('foo'); // Print's nothing

// Pass multiple arguments to be appended together
const a = 'foo';
const b = 'bar';
Logger.log(a, 'and', b); // foo and bar

// Prints errors with its stack
const err = new Error('some error');
Logger.error(err); // Error: some error <Stack trace>

Advanced Usage

Logger is a Singleton, so the same object is referenced when it is called in other files.

// Logger creates a Record object each time it is invoked
const record = Logger.log('foo');
console.log(record) // { type: 'info', timestamp: <Date>, message: 'foo' }

// Logger will emit the Record object through the 'record' event after it is invoked
Logger.on('record', (record) => {
    // do stuff
});

// Event emitting can be disabled through the emitLog property
Logger.emitLog = false;

// Records are also stored in the Logger history array
console.log(Logger.history) // [Record, Record, Record...]

// By default, the history size limit is set to 50, but can be modified through the historyLimit property
Logger.historyLimit = 10; // Sets limit to the 10 most recent log entries

Documentation


  • class Logger

    • Properties: history: {Array[Record]} Retains the most recent entries from Logger historyLimit: {Number} (Default: 50) The maximum entries to retain at any time useColors: {Boolean} (Default: true) Toggles writing to stdout printMessage: {Boolean} (Default: true) Toggles writing to stdout showTimestamp: {Boolean} (Default: true) Displays Timestamp when printing a message showTimezone: {Boolean} (Default: false) Displays Timezone when printing a message emitRecord: {Boolean} (Default: true) Emits a record event whenever an entry is created
    • Methods: info(...args): Write a message to stdout with the info format log(...args): Alias for info warn(...args): Write a message to stderr with the warning format error(...args): Write a error message to stderr with the error format
  • object Record

    • Properties: type: {String} Will be labeled as info, warn, or error timestamp: {Date} The datetime when the record was created message: {String} The content of the record colored: {String} The message with 8-bit ANSI color codes embedded

Version Log


v1.0.1

  • Fixed an bug that resulted in a TypeError. Objects now check if constructor is a valid property

v1.0.0

  • Refactor print methods to act as wrappers for original console methods
  • Implemented colored printing mode. Display data types with prefined color sets
  • Uses 8-bit ANSI color codes

v0.2.1

  • Refactored Jest tests to Taste tests

v0.2.0

  • Add printLog method to write existing Log objects to stdout

v0.1.0

  • Removed log recording functionality
  • Removed Timestamp object
  • Added Log object
  • Logger retains its log history
  • Logger emits the 'log' event
  • Refactored Logger properties into a state object