# omg-console

> A better console.log for terminal

Latest version **1.2.2** (published 2020-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install omg-console
pnpm add omg-console
yarn add omg-console
bun add omg-console
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2020-09-16 |
| First published | 2019-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 5 |
| Unpacked size | 17.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | haozime |
| Keywords | color, colors, console, terminal, 256, ansi, chalk, cli, colour, command-line, formatting, log, logging, rgb, shell, str, string, style, styles, text, tty, xterm |

## Links

- npm: https://www.npmjs.com/package/omg-console
- Homepage: https://github.com/allgay/omg-console
- Issues: https://github.com/allgay/omg-console/issues
- npm.io page: https://npm.io/package/omg-console

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [tslib](https://npm.io/package/tslib.md) 1.x.x
- [source-map](https://npm.io/package/source-map.md) ^0.7.3
- [npm-updater](https://npm.io/package/npm-updater.md) ^3.0.3
- [source-map-resolve](https://npm.io/package/source-map-resolve.md) ^0.5.2

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.2.2 (latest) — 2020-09-16
- 1.2.1 — 2020-09-16
- 1.1.2 — 2019-02-26
- 1.1.1 — 2019-02-26
- 1.1.0 — 2019-02-26
- 1.0.3 — 2019-02-26
- 1.0.2 — 2019-02-21
- 1.0.1 — 2019-02-21
- 1.0.0 — 2019-02-21

## README

# omg-console

---
![](./screenshot.png)
## 使用

```bash
npm install omg-console -save
```

```javascript
import Console from 'omg-console'
const console = new Console('my namespace')
console.log('hello world')
```

## Options

```javascript
new Console('my namespace')
new Console({name: 'xxx', verbose: true})
```

## 单例模式

```javascript
import { console } from 'omg-console'
console.log('xxx') // singleton

import { rawConsole } from 'omg-console'
rawConsole // original global.console
```

## 全局调试
```bash
# 全局环境变量
export OMG_CONSOLE_VERBOSE=true
```

## 特性

* 全功能的 console 替代方案，支持所有原生 console 方法
* 常用方法颜色高亮
* 错误会走到 stderr 流
* 支持回溯到源码对应行
* 支持 sourcemap

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