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

simple_logger

v0.1.0

Published

Lightweight log system

Readme

Simple Logger for Nodejs by Michel

It's a tasteful and lightweight Logger API, done for you. And for me, obvious :)
For suggestions or bugs visit: https://github.com/michelwooller/simple_logger/issues

Installation

npm install simple_logger

Usage


// simple usage. It will write on console for you

var simple_logger_module = require('./simple_logger');
var log = new simple_logger_module.Log();

log.debug('it\'s ok - debug');
log.info('it\'s ok - info');
log.warn('it\'s ok - warn');
log.error('it\'s ok - error');

Full config details


var simple_logger_module = require('./simple_logger');

var log = new simple_logger_module.Log({
	level : simple_logger_module.LogLevel.INFO, // default = simple_logger_module.LogLevel.DEBUG, others = simple_logger_module.LogLevel.WARN, simple_logger_module.LogLevel.ERROR
	out : process.stdout, // any object that implements write and writable methods of stream.Writable OBS: this config will override the specific outs below if them are undefined
	debugOut : process.stdout, // even though out
	infoOut : process.stdout, // even though out
	warnOut : process.stdout, // even though out
	ErrorOut : process.stdout, // even though out
	metadata : { // accepts a closure definition or false. OBS: if you not declare this config, it'll assume you want all metadata
		withDate : true, // true or false, add date
		register : 'My module', // a text will be appended on log metadata, if you not want this, declare false
		withLevel : true // true or false, add level
	}
});

log.debug('it\'s ok - debug');
log.info('it\'s ok - info');
log.warn('it\'s ok - warn');
log.error('it\'s ok - error');

Some importants examples (more on test.js)


//  ------ log on files ------ 

var simple_logger_module = require('./simple_logger'),
	fs = require('fs');

var wsd = fs.createWriteStream('./log/debug.log', { flags: 'a+', encoding: 'utf8'});
var wsi = fs.createWriteStream('./log/info.log', { flags: 'a+', encoding: 'utf8'});
var wsw = fs.createWriteStream('./log/warn.log', { flags: 'a+', encoding: 'utf8'});
var wse = fs.createWriteStream('./log/error.log', { flags: 'a+', encoding: 'utf8'});

console.log('<<< please see ./log/debug.log file >>>');
console.log('<<< please see ./log/info.log file >>>');
console.log('<<< please see ./log/warn.log file >>>');
console.log('<<< please see ./log/error.log file >>>');

config = {
	level : simple_logger_module.LogLevel.DEBUG,
	debugOut : wsd, 
	infoOut : wsi, 
	warnOut : wsw, 
	errorOut : wse, 
	metadata : false
}

var log = new simple_logger_module.Log(config);



log.debug('it\'s ok - debug');
log.info('it\'s ok - info');
log.warn('it\'s ok - warn');
log.error('it\'s ok - error');