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

leucine

v1.1.2

Published

A tiny, hybrid logging framework for the client and server side applications.

Readme

  • ✅ formatted, easy-to-read logs
  • ✅ automatic distinction between server-side and client-side logging
  • ✅ emoji first logging indicators
  • ✅ comes with 4 logging states (debug, info, warn, error)
  • ✅ easily configurable

Getting started

First, install leucine using npm/yarn/pnpn:

## npm
npm i leucine --save-dev

## yarn
yarn add leucine -D

## pnpm
pnpm add leucine -D

Then, import any of the logging modes as named imports:

import { debug, info, warn, error } from "leucine"

🎉 You're now ready to start logging:

const sum = (a, b) => a + b;

debug(sum(1,2)); //🐛 [01/01/2023 12:00:00] (debug) in index.ts: 3

Leucine formats logs in both the server side and client side environment, giving you a roundabout logging experience.

📘 Documentation

Configuring leucine

Leucine ships with a sensible, default configuration. Nonetheless, if you'd like to tinker with the defaults then you can do so in two ways:

  1. Import the named configure function
  2. Import the Leucine class and instantiate a new class with your configuration.

Both methods are viable, pick the one you're most comfortable with (using a function vs. using a class).

Then, pass in your configuration. Below we represent the available keys you can use to configure leucine:

import {configure} from "leucine" // function-based
import Leucine from "leucine" // class-based

configure({
    debugColor?: Colors;
	infoColor?: Colors;
	warnColor?: Colors;
	errorColor?: Colors;
	displayDate?: boolean;
	dateFormat?: DateFormat;
	displayTime?: boolean;
	showMilliseconds?: boolean;
	displayArgTypes?: boolean;  
})

const logger = new Leucine({
    debugColor?: Colors;
	infoColor?: Colors;
	warnColor?: Colors;
	errorColor?: Colors;
	displayDate?: boolean;
	dateFormat?: DateFormat;
	displayTime?: boolean;
	showMilliseconds?: boolean;
	displayArgTypes?: boolean;
})

To configure colors, import the Colors enum from leucine and use it when overriding the default colors:

import {Colors} from "leucine"

const configuration = {
    debugColor: Color.Red;
    //...
}

To configure date formatting, import the DateFormat enum from leucine and use it to override the default date formating:

import {DateFormat} from "leucine"
const configuration = {
    dateFormat: DateFormat.YEAR_MONTH_DAY   
    //...
}

Passing variable args to log

To pass a variable amount of arguments to log to the console or to log multiple things, use an array like so:

import {debug} from "leucine"

const someVar = "I'm a variable!"

debug(["This is a string", someVar, 10]) // 🐛 (debug): ["This is a string", "I'm a variable", 10]

⚙️ API Reference

Leucine(config)

  • config: LeucineConfig
  • Returns instantiated Leucine class

debug(arg)

  • arg: T
  • Returns void

info(arg)

  • arg: T
  • Returns void

warn(arg)

  • arg: T
  • Returns void

error(arg)

  • arg: T
  • Returns void

configure(config)

  • config: LeucineConfig
  • Returns void