kons
TypeScript icon, indicating that this package has built-in type declarations

0.7.1 • Public • Published

kons

NPM version

An elegant console logger.

Features

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

Installation

# NPM
$ npm install kons -S

# 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 { createFormatter } from "kons";

// Parameter 1: Log type
// Parameter 2: Log background color, see [picocolors](https://npmjs.com/package/picocolors) for available colors
// Parameter 3?: Log options, see types for more information
const myLog = createFormatter("myLog", "cyan", { target: console.info, textColor: "green" });

License

MIT License © 2022 Ray

Package Sidebar

Install

npm i kons

Weekly Downloads

339

Version

0.7.1

License

MIT

Unpacked Size

12.3 kB

Total Files

12

Last publish

Collaborators

  • so1ve