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

@rizkyhaksono/npm-beautify-log

v1.0.1

Published

Beautified TypeScript logger for Next.js with info/debug/warn/error levels

Readme

@rizkyhaksono/npm-beautify-log

Beautified logger untuk Next.js dengan TypeScript.

Fitur utama:

  • level log: info, debug, warn, error
  • output rapi dengan timestamp lokal
  • warna otomatis untuk terminal yang mendukung ANSI
  • aman untuk SSR dan CI (auto fallback tanpa warna)
  • tanpa runtime dependency

Install

npm install @rizkyhaksono/npm-beautify-log

Quick Start

import { logger } from "@rizkyhaksono/npm-beautify-log";

logger.info("Server ready", { port: 3000 });
logger.debug("Payload", { id: 42 });
logger.warn("Cache miss");
logger.error("Query failed", new Error("DB timeout"));

Custom Logger

import { createLogger } from "@rizkyhaksono/npm-beautify-log";

const appLogger = createLogger({
  env: process.env.NODE_ENV,
  timestamp: true,
  timestampLocale: "id-ID",
  timestampTimeZone: "Asia/Jakarta",
  useColors: "auto",
  prettyMeta: true,
  prefix: "[my-next-app]",
});

appLogger.info("Booting app");

Opsi Konfigurasi

  • level: level minimum log (debug | info | warn | error)
  • useColors: true, false, atau "auto"
  • timestamp: aktif/nonaktif timestamp
  • timestampLocale: default id-ID
  • timestampTimeZone: default Asia/Jakarta
  • env: untuk default level (development => debug, selain itu info)
  • prettyMeta: pretty print metadata JSON
  • prefix: prefix text tambahan di awal log

Contoh di Next.js

App Router - Server

// app/api/health/route.ts
import { logger } from "@rizkyhaksono/npm-beautify-log";

export async function GET() {
  logger.info("Health endpoint called");
  return Response.json({ ok: true });
}

Client Component

"use client";

import { logger } from "@rizkyhaksono/npm-beautify-log";
import { useEffect } from "react";

export function ExampleClient() {
  useEffect(() => {
    logger.debug("Client mounted");
  }, []);

  return <div>Check console</div>;
}

Development

npm run lint
npm run build
npm test

Cara Upload ke npm Web (npmjs.com)

  1. Buat akun di https://www.npmjs.com/signup dan verifikasi email.

  2. Login dari terminal:

    npm login
    npm whoami
  3. Pastikan nama package siap dipublish:

    npm view @rizkyhaksono/npm-beautify-log

    Jika belum ada hasil, nama masih tersedia.

  4. Naikkan versi sebelum publish berikutnya:

    npm version patch
  5. Cek isi paket yang akan diupload:

    npm pack --dry-run
  6. Publish public package:

    npm publish --access public
  7. Buka halaman package di npm web:

    https://www.npmjs.com/package/@rizkyhaksono/npm-beautify-log

Rilis Update Selanjutnya

  • Perbaikan bug: npm version patch
  • Fitur baru kompatibel: npm version minor
  • Breaking change: npm version major

Lalu jalankan:

git push --follow-tags
npm publish --access public