Catalog npm
PACKAGE EXPLORERView in registry

0xlogs

npm

Lightweight and configurable logging utility for Node.js with JSON support and file logging.

debugerrorfileinfojsonlogloggerloggingnodejsprocesswarn
Versions collected5
Direct dependencies0From release 1.0.1
Last observed20 Oct, 17:51 UTC

README

Current package documentation

0xLogs

0xLogs is a lightweight and configurable logging utility for Node.js applications. It supports JSON parsing, file output, and built-in process event logging to help monitor your app's health and behavior with minimal setup.


📦 Installation

npm install 0xlogs

🚀 Features

  • Logging with custom levels: info, warn, error, debug
  • Optional JSON formatting
  • File logging support
  • Safe schema validation
  • Auto-handling for:
    • uncaughtException
    • unhandledRejection
    • SIGINT, SIGTERM, exit
    • Warnings and IPC messages

🛠️ Usage

Basic Example

const CreateLog = require("0xlogs");

const log = new CreateLog({
  type: "info",
  filePath: "./logs.txt",
  json: true
});

log("App started", { port: 3000 });

Update Config

log.setConfig({
  type: "error",
  json: false
});

⚙️ Config Options

OptionTypeDefaultDescription
typeStringinfoLog level (info, warn, error, debug)
filePathStringundefinedPath to output log file (optional)
jsonBooleantrueEnable JSON formatting for logs

📂 Built-in Process Logging

When require("0xlogs") is invoked, it automatically logs:

  • Uncaught exceptions and rejections
  • Signals like SIGINT, SIGTERM
  • Process exit events
  • IPC messages (process.send)
  • Warnings

Example logs:

[~] [ERROR] Uncaught Exception: ...
[~] [INFO] Exited Application.
[~] [WARN] A promise rejection was handled asynchronously: ...

📁 File Structure (for contributors)

0xlogs/
├── lib/
│   ├── index.js        # Combines validation utilities and config types
│   ├── process/
│   │   ├── index.js    # Handles process-level logging
│   ├── types/
│   │   ├── index.js    # Schema definition
│   ├── functions/
│   │   ├── index.js    # Config & path validation
├── index.js            # Main class (CreateLog)

📜 License

MIT © 2025

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 5

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.1Registry latest12 May 20250
1.0.011 May 20250
0.0.311 May 20250
0.0.210 May 20250
0.0.110 May 20250

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
shadym00n/0xlogs

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:51 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:8023718046a6d032bfca3572e6e45d23cd1cb6f7c5146b6ec8591c82623729a2