# kons

> An elegant console logger.

Latest version **0.7.1** (published 2023-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install kons
pnpm add kons
yarn add kons
bun add kons
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.7.1 |
| Published | 2023-04-22 |
| First published | 2022-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Ray |
| Maintainers | so1ve |
| Keywords | console, logger, reporter, universal, unified, winston, elegant |

## Links

- npm: https://www.npmjs.com/package/kons
- Repository: https://github.com/so1ve/kons
- Homepage: https://github.com/so1ve/kons#readme
- Issues: https://github.com/so1ve/kons/issues
- npm.io page: https://npm.io/package/kons

## Dependencies (2)

- [figures](https://npm.io/package/figures.md) 5.0.0
- [picocolors](https://npm.io/package/picocolors.md) ^1.0.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.7.1 (latest) — 2023-04-22
- 0.7.0 — 2023-02-21
- 0.6.2 — 2022-12-29
- 0.6.1 — 2022-12-29
- 0.6.0 — 2022-12-29
- 0.5.4 — 2022-10-31
- 0.5.3 — 2022-08-18
- 0.5.2 — 2022-08-18
- 0.5.0 — 2022-08-18
- 0.4.0 — 2022-08-18
- 0.3.0 — 2022-08-16
- 0.2.3 — 2022-08-15
- 0.2.2 — 2022-08-15
- 0.2.1 — 2022-08-14
- 0.2.0 — 2022-08-14
- … 3 more at https://npm.io/package/kons/versions

## README

# kons

[![NPM version](https://img.shields.io/npm/v/kons?color=a1b858&label=)](https://www.npmjs.com/package/kons)

An elegant console logger.

## Features

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

## Installation

```console
# NPM
$ npm install kons -S

# Yarn
$ yarn add kons

# PNPM
$ pnpm add kons
```

## Usage

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

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

Output:

![](./assets/output.png)

### Advanced Usage

```ts
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) License © 2022 [Ray](https://github.com/so1ve)

---
_Source: https://npm.io/package/kons · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
