# 0console

> Patched console functions with improved output.

Latest version **0.0.1** (published 2022-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install 0console
pnpm add 0console
yarn add 0console
bun add 0console
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-03-06 |
| First published | 2022-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 439.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ambratolm |
| Maintainers | ambratolm |
| Keywords | console, color, status, level |

## Links

- npm: https://www.npmjs.com/package/0console
- Repository: https://github.com/simple-works/0console
- Homepage: https://github.com/simple-works/0console#readme
- Issues: https://github.com/simple-works/0console/issues
- npm.io page: https://npm.io/package/0console

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^4.1.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

- 0.0.1 (latest) — 2022-03-06

## README

# ✒️ 0console

[![NPM version](https://badge.fury.io/js/0console.svg)](https://npmjs.org/package/0console)

Simple patched console functions with improved output.

![Screenshot](./screenshot.jpg?raw=true)

# 📥 Install

```
npm i 0console
```

# 🏁 Use

With patched console object:

```js
require("0console").patch();

console.log("Hello World!");
console.log("Highlighted", "Hello World!");
```

Without patching the console object:

```js
const $console = require("0console");

$console.log("Hello World!");
$console.log("Highlighted", "Hello World!");
```

# ⚙️ Functions

- `console.log(...args)` : Writes a normal message.
- `console.info(...args)` : Writes an information message.
- `console.warn(...args)` : Writes a warning message.
- `console.error(...args)` : Writes an error message.
- `console.clear(...args)` : Clears the output (Unlike the original).
- 🆕 `console.success(...args)` : Writes a success message.
- 🆕 `console.line(char?, color?, count?)` : Writes an horizontal line.
  - `char` : text to repeat (one character).
  - `color` : text color in the console (Using [Chalk](https://github.com/chalk/chalk)).
  - `count` : times to repeat `char` (Length of the line).

💡 If a logging function (log, info, warn, error, success) has more than one argument, the text of the first argument will be highlighted in the console.

# ⚙️ Craft Function

You can craft your own custom function:

```js
const $console = require("0console");

const newConsoleInfo = $console.craft(console.info, {
  prefix: { text: "?", color: "cyanBright", bgColor: "bgBlueBright" },
  highlight: { color: "blueBright" },
  normal: { color: "blueBright" },
});
```

- `console.craft(fn, options?)` : Crafts a patched version of the given console function.
  - `fn` : Console function to craft from.
  - `options` : Options object.
    - `prefix` : Object describing the prefix text.
      - `text`: Text of the prefix.
      - `color`: Color of the prefix.
      - `bgColor`: Background color of the prefix.
    - `highlight` : Object describing the highlighted text of the first argument.
      - `color`: Color of the highlighted text.
    - `normal` :  Object describing the normal text.
      - `color`: Color of the normal text.

# 📃 License
[MIT](./LICENSE) © [Ambratolm](https://github.com/Ambratolm)

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