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

@404invalid-user/logger

v1.0.1

Published

a simple logger that also has webhooks

Readme

logger

a simple logger for nodejs that allows you to log to a file and a to many platforms using webhooks.

examples

some examples to get you started.

basic

a simple logger


const {BasicLogger} = require('@404invalid-user/logger');

const  logPath = './logs.log';
const  allowDebugLogs = true;
const  log = new BasicLogger(logPath, allowDebugLogs);

log.success("app is running");
log.info("app is still running");
log.debug("line 8");
log.warn("app will be stopping");
log.error("app has stopped");

a more advanced logging system with more options please see the docs for more details on confg options.

const {AdvancedLogger} = require('@404invalid-user/logger');
const  loggerConfig = {
  filePath:"./logs.log",
  webhook: {
    discord:  "https://discord.com/api/webhook/blblbalabla",
  },
  debug:true
}

const  log = new AdvancedLogger(loggerConfig);

log.success("app is running");
log.info("app is still running");
log.debug("line 14");
log.warn("app will be stopping");
log.error("app has stopped");

using console

its very simple instead of doing const log = AdvancedLogger(loggerConfig); you would do console = AdvancedLogger(loggerConfig);


const {AdvancedLogger} = require('@404invalid-user/logger');
const  loggerConfig = {
  filePath:"./logs.log",
  webhook: {
    discord:  "https://discord.com/api/webhook/blblbalabla",
  },
  debug:true
}
console = new AdvancedLogger(loggerConfig);

console.log("starting app");
console.success("app is running");
console.info("app is still running");
console.debug("line 14");
console.warn("app will be stopping");
console.error("app has stopped");

docs

config options

the config will be a object passed into the AdvancedLogger class.

each function will have its own object with the name of that function each function config object is the same so i will just use success for this example.

first you can disable each logging function by passing false instead of the object.

//example
const {AdvancedLogger} = require('@404invalid-user/logger');
const  loggerConfig = {success:false}
const  log = new AdvancedLogger(loggerConfig);

//will not do anything
log.success("app is running");
//will work as normal
log.info("app is still running");

each function object will have this schema.

{
   "logPath": "relative/path/from/app.dir",
   "color": " your log name text colour see colours",
   "textColor": "the colour of the text your logging see colours",
   "webhook": {
       "discord":"a discord webhook url",
       "googleChat":"a google chat webhook url"
   }
}

for a full example of all the functions in action please see /examples

class

.BasicLogger(logPath: string, allowDebugLogs: boolean)

a basic logger to get the job done.

returns an instance of the basic logger

class

.AdvancedLogger(configOptions: object)

the configurable logger

returns an instance of the advanced logger.

function

.success(text: string)

send a success message to the console and log file if specified.

returns null

function

.info(text: string)

send a info message to the console and log file if specified.

returns null

function

.debug(text: string)

send a debug message to the console and log file if specified for debugging default is off so none of these will get logged in production.

returns null

function

.warn(text: string)

send a warning to the console and log file if specified.

returns null

function

.error(text: string)

send a error message to the console and log file if specified.

returns null

function

.crash(text: string)

send a crash message to the console and log file if specified.

returns null

function

.log(text: string)

a simple plain old log console and log file if specified for if you chose to redefine console as this to the.

returns null