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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@simpplejs/logger

v0.0.1

Published

Simple logger

Downloads

2

Readme

Logger

Description

A tiny Node.js logger that is based on debug module.

Usage

If you have ever used debug module, it will be easy for you. Like debug module, this module exposes a function. Just pass a name of your module into this function and it will return an accustomed logger interface.

  • error()
  • warn()
  • info()
  • debug()

The first benefit is different suffixes which added to the namespace. Let's see.


const logger = require('debug')('test');

logger.error('something happened wrong') // **test.error** error happened +0ms
logger.warn('something happened wrong') // **test.warn** something happened wrong +0ms
logger.info('just some neutral information') // **test.info** just some neutral information +0ms
logger.debug('some boring data', {a: 1, b: 2}) // **test.debug** some boring data { a: 1, b: 2 } +0ms

So, you will be able to recognize different levels of messages.

As a common logger this one works with LOG_LEVEL. Just set the one of the following ['error', 'warn', 'info', 'debug'] level to env LOG_LEVEL . After that manipulation, the set level will be highest. It means LOG_LEVEL=warn will show you messages with suffix error and warn.

The second benefit is using of wildcard. All is you need is set env DEBUG Let's see on common patterns:

  • * - show all the logs
  • *.level - show logs from all the modules with specific level
  • module.* - show all level logs of some specific module
  • module.level - show specific level logs of specific module

Benchmark

logger.info*10000 ~ 328ms