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

dev-console-kit

v2.1.0

Published

The ultimate debugging toolkit for React & Next.js students. Features log levels, named loggers, useLogger hook, environment detection, mentor tips, component tracking, and CSS debugging.

Downloads

49

Readme

Dev Console Kit

A smart, colorful, and educational logging utility designed for React & Next.js students. It helps you debug faster, understand Server/Client environments, track component renders, and fix CSS layout issues instantly.


Features (v2.1.0)

Log Levels: Filter by debug < info < success < warning < error with setLevel() or configure({ level }).

React Hook: useLogger() from dev-console-kit/hooks — component-scoped logs, render tracking, mount/unmount.

Environment Detection: Automatically labels logs as [CLIENT] or [SERVER].

Configuration: configure() now actually applies showTimestamp, prefix, theme, and level.

Named Loggers: Logger.create('API') with the full API (time, inspect, per-logger setLevel).

Component Tracking: Track React component render cycles and performance.

Advanced CSS Debugging: Highlight padding, margins, overflow, and flexbox containers.

Mentor Tips: A random "Clean Code" tip in the console on every refresh (30+ categorized tips).

Pretty Logs: Color-coded success, error, warning, info, and debug messages.

Performance Tracking: Built-in timer functions to measure execution time.

Toggle Logging: Enable/disable all logs for production builds.

TypeScript Support: Full generic type definitions with enhanced type safety.


Installation

npm install dev-console-kit

or

yarn add dev-console-kit

React is an optional peer dependency. You only need it if you use useLogger.

import Logger from 'dev-console-kit';

Logger.success("dev-console-kit is working!");

🚨 Next.js Users - Important!

If you're using Next.js 13+ App Router, use the Provider pattern to ensure configuration works across all pages:

// app/providers.js
'use client';

import { useEffect } from 'react';
import { configure } from 'dev-console-kit';

export function LoggerProvider({ children }) {
  useEffect(() => {
    configure({
      enabled: process.env.NODE_ENV === 'development',
      persist: true // Saves to localStorage
    });
  }, []);
  
  return <>{children}</>;
}

// app/layout.js
import { LoggerProvider } from './providers';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <LoggerProvider>{children}</LoggerProvider>
      </body>
    </html>
  );
}

See examples/nextjs-usage.js for more details.


Usage

import Logger, { configure } from 'dev-console-kit';

1. Configuration

configure({
  enabled: process.env.NODE_ENV === 'development',
  showTimestamp: true,
  showTips: true,
  prefix: '[MY-APP]',
  theme: 'default', // 'default' | 'dark' | 'light'
  level: 'debug'    // 'debug' | 'info' | 'success' | 'warning' | 'error'
});

2. Log Levels (NEW in v2.1)

Messages below the active minimum are hidden. Hierarchy (most verbose → most severe):

debug < info < success < warning < error

Logger.setLevel('warning'); // only warning + error
Logger.debug('hidden');
Logger.info('hidden');
Logger.success('hidden');
Logger.warning('shown');
Logger.error('shown');

Logger.getLevel(); // 'warning'

configure({ level: 'error' }); // production: errors only

Named loggers can override the global level:

const api = Logger.create('API');
Logger.setLevel('error');
api.setLevel('debug'); // this logger still verbose

3. Named Loggers

const apiLogger = Logger.create('API');
const uiLogger = Logger.create('UI');

apiLogger.success("Request completed"); // [API] ✅ Request completed
uiLogger.error("Render failed");         // [UI] ❌ Render failed

apiLogger.time('fetchUsers');
apiLogger.inspect('payload', { id: 1 });
apiLogger.timeEnd('fetchUsers');

4. useLogger() Hook (NEW in v2.1)

Client Components only. Import from the hooks entry so the core package stays React-free:

'use client';
import { useLogger } from 'dev-console-kit/hooks';

function Checkout() {
  const log = useLogger('Checkout');

  log.success('ready');
  return <div>Checkout</div>;
}

By default this tracks renders and logs mounted / unmounted. Opt out if you want a quiet logger:

const log = useLogger('Checkout', {
  track: false,
  logLifecycle: false,
  props: { step: 2 }
});

5. Component Tracking

function MyComponent(props) {
  Logger.trackComponent('MyComponent', props);
  return <div>Hello</div>;
}

const stats = Logger.getComponentStats('MyComponent');
// { renderCount: 5, lastRender: 123.45, firstRender: 1.02 }

6. Smart Logging

Logger.success("User logged in successfully!");
Logger.error("API Connection Failed", { error: 500 });
Logger.warning("This component is deprecated.");
Logger.info("Application started on port 3000");
Logger.debug("Detailed debugging info", { state: "loading" });

Logger.success("User loaded", userData);

7. Performance Tracking

Logger.time("API Call");
await fetchUserData();
Logger.timeEnd("API Call"); // "API Call: 245.32ms"

8. Toggle Logging

if (process.env.NODE_ENV === 'production') {
  Logger.setEnabled(false);
}

setEnabled(false) silences everything. Prefer setLevel('error') if you still want failures in production.

9. Inspecting Data

const user = { id: 1, name: "John", role: "Admin" };
Logger.inspect("User Data", user);

10. Advanced CSS Layout Debugging

Logger.debugLayout();

Logger.debugLayout({
  showPadding: true,
  showMargin: true,
  highlightOverflow: true,
  showFlexbox: true
});

Tip: Call Logger.debugLayout() once, identify your layout issue, then remove the call.


API Reference

Core Logging Methods

Logger.success<T>(msg, data?)

Logs a success message with optional data.

Logger.error<T>(msg, error?)

Logs an error message with optional error details.

Logger.warning(msg)

Logs a warning message.

Logger.info<T>(msg, data?)

Logs an informational message with optional data.

Logger.debug<T>(msg, data?)

Logs a debug message (useful for verbose logging).

Configuration & Management

configure(config)

configure({
  enabled?: boolean;
  showTimestamp?: boolean;
  showTips?: boolean;
  prefix?: string;
  theme?: 'default' | 'dark' | 'light';
  level?: 'debug' | 'info' | 'success' | 'warning' | 'error';
  persist?: boolean;
})

Logger.setEnabled(enabled)

Enables or disables all logging.

Logger.setLevel(level) / Logger.getLevel()

Sets or reads the global minimum log level.

Advanced Features

Logger.create(name)

Creates a named logger (success, error, warning, info, debug, inspect, time, timeEnd, setLevel, getLevel).

Logger.trackComponent<P>(componentName, props?)

Tracks React component render cycles (client-side only).

Logger.getComponentStats(componentName?)

Gets component tracking statistics.

useLogger(name, options?)

From dev-console-kit/hooks. Returns a named logger tied to a React component.

Debugging Tools

Logger.inspect<T>(label, object)

Inspects and displays an object in a structured format.

Logger.time(label) / Logger.timeEnd(label)

Starts and ends a performance timer.

Logger.debugLayout(options?)

Activates CSS layout debugging mode (browser only).


Mentor Tips

The package includes 30+ categorized mentor tips covering React, Next.js, CSS, Performance, Clean Code, and Debugging. A random tip is displayed in the browser console on every refresh.


TypeScript Support

This package includes TypeScript definitions. No additional @types package needed.

import Logger from 'dev-console-kit';
import { useLogger } from 'dev-console-kit/hooks';

Logger.success("Fully typed!", { id: 1 });

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

ISC License - See LICENSE file for details.


Author

Murat Hüdavendigâr Öncü
Website
GitHub


Support

If you find this package helpful, please give it a ⭐️ on GitHub!

For issues and questions, visit the Issues page.