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

check-log-level

v0.2.0

Published

A small Node library that determines your current log level.

Downloads

9

Readme

log-level

A small Node library that determines your current log level.

Overview

Most logging libraries are just that -- logging libraries. This one is different. It doesn't try to log your messages or connect to some fancy cloud-based aggregation service.

Instead -- it provides you an API that allows you to determine, in code, what your current level is -- based on process.evn.LOG_LEVEL environmental variable.

This way you can align your various logging modules (morgan, winston and custom, for instance) to the same value.

API

The API is very simple -- provided you required the log-level module in the following manner:

const LOG_LEVEL = require('log-level');

LOG_LEVEL provides the following immutable properties:

  • TRACE
  • DEBUG
  • INFO
  • WARNING
  • ERROR
  • FATAL

each corresponding to the current log level as set by process.env.LOG_LEVEL.

Custom Decision Function

You can, alternatively, override the function that determines the log level and the default log level (INFO instead of TRACE, in example below):

const init = require('log-level/lib/custom');

LOG_LEVEL = init(function(level) {
    return (process.env.LOG_LEVEL === level.toLowerCase());
}, 'INFO');

which would then allow you to call the same API:

if (LOG_LEVEL.INFO) {
    // do something when the log level is set to INFO
}