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

imed-logger

v0.1.4

Published

my simple logger

Readme

NPM Version Build Status NPM

imed-logger

A small library providing utility methods to log messages into console.

Installation

npm install imed-logger --save

Usage

const {
	error,
	warn,
	info,
	verbose,
	debug,
	silly,
	assert,
	inspect
} = require('imed-logger'); // => levels: info, debug, warn, error

const {
	error,
	warn
} = require('imed-logger').level('warn'); // => levels: warn, error

To disable a method for a module some function use the silent function, e.g.:

const {
	silent: info,
	debug,
	silent: warn
} = require('imed-logger'); // => will log on debug() but not on info() nor on warn()

info('this message will not be log because silent is used');
debug('this message will be logged as a debug message');
warn('this message will not be log because silent is used');

Levels

Levels order is :

error > warn > info > verbose > debug > silly

Default level is info. You can change level on runtime with:

logger.level('warn'); // => only warn and error will then actually log to console.

or get the current level with:

logger.level(); // => 'warn'

Theme : colors and styles

To change default colors, call setTheme with one or more levels colorization

logger.setTheme({
	error: ["white", "bold", "bgRed"],
	warn: ["yellow", "bold"],
	info: ["cyan", "bold"],
	verbose: ["blue", "bold"],
	debug: "magenta",
	silly: "rainbow"
};

For instance,

logger.setTheme({'silly': ['white', 'bold', 'bgBlue']});
logger.silly("a silly message");

results in :

[silly] 2019-6-20 12:01:04 a silly message

For more information on text and background colors, styles and extras, see https://github.com/Marak/colors.js.

To disable colors you can pass the following arguments in the command line to your application:

node myapp.js --no-color

Tests

npm test

Documentation

npm run docs

will generate the documentation and open its index.html file. It's a shortcut of:

npm run generate-docs
npm run show-docs

If the index.html file does not show in your browser, edit package.json file and see if version number should be updated in scripts["show-docs"], or open file in ./docs/imed-logger/<version>/index.html (e.g. ./docs/imed-logger/0.1.3/index.html).

Contributing

No formal styleguide imposed, just take care to maintain the existing coding style.

  • Add unit tests for any new or changed functionality.
  • Lint and test your code.
  • Take special care to comment your code with JSDoc3, see jsdoc.app.

Release History

  • 0.1.3 minor corrections --Thu Jun 20 14:27:31 CEST 2019

  • 0.1.2 tag correction. --Thu Jun 20 14:06:46 CEST 2019

  • 0.1.1 changed the npm run show-docs command. --Thu Jun 20 13:42:39 CEST 2019

  • 0.1.0 added setTheme function, and 1st commit to github. --Thu Jun 20 12:07:09 CEST 2019

  • 0.0.2 added inspect and assert functions. --Wed Jan 18 2017 10:11:00 GMT+0100 (CET)

  • 0.0.1 Initial release. --Fri May 13 2016 19:52:00 GMT+0200 (CEST)

About me

see www.imed.ch.


© imed.ch - Last modified : Thu Jun 20 11:04:36 CEST 2019