JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 538
  • Score
    100M100P100Q99684F
  • License MIT

Package Exports

  • kons

Readme

kons

NPM version

An elegant console logger for Node.js.

Features

  • Tiny (Minified + Gzipped ≈ 0.1kB). Beautiful. Easy to use.
  • Customizable.
  • TypeScript type declarations included.
  • NO_COLOR friendly.

Installation

# NPM
$ npm install kons

# Yarn
$ yarn add kons

# PNPM
$ pnpm add kons

Usage

import { error, info, log, success, warn } from "kons";

log("Hello World!");
info("This is kons!");
warn("Warning!");
error("Error!");
success("Success!");

Output:

Advanced Usage

import { createLogType } from "kons";

// Parameter 1: Log type
// Parameter 2: Log color, see [picocolors](https://npmjs.com/package/picocolors) for available colors
// Parameter 3?: Log target, a function that accepts a string
const myLog = createLogType("myLog", "cyan", console.info);

License

MIT License © 2022 Ray