v1.1.1 · zero dependencies · ~880 bytes

Log success
like you mean it.

console.success() prints green, checkmarked messages in your terminal and your browser console. One line. Zero config. Cross-platform.

npm version npm downloads License: MIT
01

Live, interactive demo

This runs the real console-success library loaded from the CDN. Open your browser DevTools console to see the styled output, and watch it mirrored below.

playground.js

Enter JavaScript values, comma-separated. Objects & arrays are supported.

Try:
console output idle

Output appears here. Hit Run to call console.success().

💡 Also open DevTools → Console to see the styled, colored log rendered natively by your browser.

02

Installation

Pick your package manager. It's tiny, so installing is instant.

npm
npm install console-success
pnpm
pnpm add console-success
yarn
yarn add console-success
CDN
<script src="https://unpkg.com/console-success@latest/dist/index.js"></script>
03

Usage

Same API everywhere. Import once, call console.success() anywhere.

const 'console-success'; // attaches console.success

console.success('Task completed successfully!');
console.success(new Date()); // works with any data type
import 'console-success';

console.success('Hello from the browser!');
<!-- drop-in, no build step -->
<script src="https://unpkg.com/console-success@latest/dist/index.js"></script>
<script>
  console.success('Hello world!');
</script>
⚠️ Browser note: In the browser console, objects & arrays are shown as JSON strings ({"status":"ok"}) because styled logs can't render inspectable objects. Node.js preserves full object formatting.
04

Why console.success?

Small enough to forget about, useful enough to reach for every day.

🎨

Colored output

Green styling with a checkmark icon — ANSI codes in Node, CSS styles in the browser. Resets cleanly.

🌐

Cross-platform

One library, identical API for Node.js and the browser. Auto-detects its environment.

📦

Tiny footprint

Roughly 880 bytes minified, ~0.47 kB gzipped. No runtime dependencies at all.

🚀

Zero config

Import it once. console.success is globally available — no wrappers, no setup.

🛡️

Safe with edge cases

Handles null, undefined, functions, numbers and even circular references without crashing.

🧪

Well tested

Unit tests (Vitest) and browser E2E tests (Playwright) keep both environments green.

~880Bminified
0.47kBgzipped
0dependencies
2environments

Ready to make success loud?

npm install console-success