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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@codump/conlog

v2.0.8

Published

console log management and utility tool

Downloads

50

Readme

ConLog() console log management and utility tool

dependencies 👈🥳 npm v GitHub Clones npm downloads last commit

Run npm i @codump/conlog

[!TIP] We are launching our website with demo and documentation! https://codump.github.io/conlog/

Minimal to go:

const { ConLog, ConLogStartMsg } = require('@codump/conlog')

/**
 * This is so minimal you can even remove it, just do that *after* setting things up.
 * Otherwise the startup message (that shows your settings) won't appear.
 * You can also drop ConLogStartMsg from the import if you don't need it.
 */
ConLogStartMsg(true)

/**
 * And here's the core feature:
 * ConLog() that's it, that simple!
 */
ConLog('Confirm! Type 2 => ok in console', 2)

/**
 * Okay I trolled a bit earlier, the real minimal example is even shorter.
 * But we’re looking out for newcomers here so please forgive me
 */

For real this time:

const { ConLog } = require(`@codump/conlog`)

ConLog(`Sorry! Hope I didn't upset you again with an error!?`, 1);

How to use in frontend:

ConLog() works in both back- and frontend. We can use the ESM>CDN to import it to the front with zero install needed! Browser needs to support ES6.

// script.js
import { ConLog } from `https://esm.sh/@codump/conlog`

ConLog(`It's the same as in the backend, all details are below.`, 2);

Make sure the script where you are importing it has the module type.

<script type='module' src='script.js'></script>

Let's check the full details:

/**
 * ConLog - Console log management and utility tool
 * 
 * In the repo example.js is set with require(`./lib/`) but copy paste the code below
 * when you use it after a `npm install @codump/conlog`
 */
const { ConLogInit, ConLogSet, ConLog, ConLogStartMsg } = require(`@codump/conlog`)

// ================================
// INITIALIZATION
// ================================

/**
 * Initialize ConLog with global enable/disable setting
 * 
 * @param {boolean} status - Master switch for all console logging
 *   - true: Enable all ConLog output (default)
 *   - false: Completely disable all ConLog output
 *   - Every ConLog after ConLogInit(false) stops working
 */
ConLogInit(true)

// ================================
// CONFIGURATION
// ================================

/**
 * Configure which log types are displayed
 * All parameters default to true, so you only need to specify false values
 * 
 * @param {boolean} error - Display error messages (type 1)
 * @param {boolean} ok - Display success/OK messages (type 2)  
 * @param {boolean} warning - Display warning messages (type 3)
 * @param {boolean} object - Display object dumps (type 4)
 * @param {boolean} color - Enable colored console output
 * 
 */
ConLogSet({error: true, ok: true, warning: true, object: true, color: true})

/**
 * Display startup message showing current ConLog settings
 * Useful for debugging or confirming ConLog is properly initialized
 * 
 * @param {boolean} status - Whether to display startup message (default: false)
 */
ConLogStartMsg(true)

// ================================
// LOGGING EXAMPLES
// ================================

/**
 * Main logging function - ConLog(text, type)
 * 
 * TYPE OPTIONS:
 * - Error:   1, `er`, `err`, `error`
 * - Success: 2, `ok` 
 * - Warning: 3, `wa`, `war`, `warn`, `warning`
 * - Object:  4, `so`, `ob`, `obj`, `object`, `showobject`
 *   - Gives a stringify to the output. Don't set any type if you want to log the raw object. 
 * 
 * USAGE:
 * - ConLog(text, type) - Typed logging with formatting
 * - ConLog(text) - Simple logging without type (always displayed unless ConLogInit is false)
 */

// Sample data for object logging
const nestedData = [{ nestedObj: `inside nested structure` }]
const complexObject = [{ 
    test: `valid test data`, 
    nested: nestedData,
    timestamp: new Date().toISOString()
}];

/ Error logging - displayed in red
ConLog(`Example... Database connection failed.`, 1)
ConLog(`Example... Invalid user credentials provided.`, `error`)

// Success logging - displayed in green
ConLog(`Example... User successfully authenticated.`, 2)
ConLog(`Example... File upload completed.`,`ok`)

// Warning logging - displayed in yellow with warning icon
ConLog(`Example... API rate limit approaching.`, 3)
ConLog(`Example... Deprecated function usage detected.`, `warning`)

// Object logging - formatted JSON display
ConLog(complexObject, 4)
ConLog({ userId: 123, status: `active`, permissions: [`read`, `write`] }, `object`)

// Simple logging - no special formatting, always displayed (unless ConLogInit is false)
ConLog(`Example... Processing user request...`)