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

silence-log

v0.2.0

Published

Agnostic logger factory to unify them all, without any Sauron

Downloads

1,972

Readme

silence-log

A tiny framework that provide a log facade, inspired by the Java SLF4J.

Motivation

Which log framework would you use when creating your own Node library? Bunyan ? Winston ? Log ? ...?

There is no right answer because you try to take a decision not in your scope.

Imagine that John build an application that uses:

  • Your framework, using Bunyan
  • Another one, using Winston.

John now have to handle differents logging framework.

This framework follow the idea of SLF4J: framework should use an interface and applications decides which implementation they want.

How does it work?

Making some logs

After installing npm install --save silence-log, you can just do this kind of code.


var engineLogger = require('silence-log').get("pegasus.engine");
engineLogger.app({
	name: 'MyApp'
});
engineLogger.warn("engine overheating");

The get method gives youe the specific logger, creating it if needed. The name provided is hierarchically constructed, with 'dot' separator. Try to always start your loggers names with your npm project name.

Methods available to log are:

  • trace
  • debug
  • info
  • warn
  • error

That's it.

Configurating

In your final application or in your library testing code, you have to provide a configuration to really see your logs.

First of all, require silence-log as soon as possible, to ensure that your installed version will be used event if other dependencies used another one. Then, require a configuration file.

The easy way is to create a log.js file and require it in the first line of your application entry point.


var factory = require('silence-log');

function consoleAppender(app, loggerName, level, msg){
	console.log(`${level.toUpperCase().padStart(6, ' ')} [${app.name}] ${loggerName} :: ${msg}`);
}

//Define the root logger appender (and any child) on debug, so for [error, warrn, info, debug] but not trace
factory.get('').addAppender("debug", consoleAppender);

//Remove this appender from anotherFramework (and any child) from info, so [info, debug, trace] but allow it for [error, warn]
factory.get('anotherFramework').removeAppender('info', consoleAppender);

Binding with other framework

It's not yet done but you can provide me help