# mdlog

> Markdown on `console.log`

Latest version **1.0.3** (published 2015-06-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2015-06-08 |
| First published | 2015-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 31 |
| Author | TSUYUSATO Kitsune |
| Maintainers | makenowjust |
| Keywords | markdown, console, log, browser, develop |

## Links

- npm: https://www.npmjs.com/package/mdlog
- Repository: https://github.com/MakeNowJust/mdlog
- Issues: https://github.com/MakeNowJust/mdlog/issues
- npm.io page: https://npm.io/package/mdlog

## Dependencies (3)

- [mdast](https://npm.io/package/mdast.md) ^0.21.1
- [lodash](https://npm.io/package/lodash.md) ^3.9.2
- [color-string](https://npm.io/package/color-string.md) ^0.3.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

- 1.0.3 (latest) — 2015-06-08
- 1.0.2 — 2015-06-08
- 1.0.1 — 2015-05-25
- 1.0.0 — 2015-05-25
- 0.4.1 — 2015-05-03
- 0.4.0 — 2015-04-28
- 0.3.1 — 2015-04-28
- 0.3.0 — 2015-04-27
- 0.2.1 — 2015-04-27
- 0.2.0 — 2015-04-27
- 0.1.2 — 2015-04-27
- 0.1.1 — 2015-04-26
- 0.1.0 — 2015-04-26

## README

# mdlog

Markdown on `console.log`

[![npm](https://img.shields.io/npm/v/mdlog.svg)](https://www.npmjs.com/package/mdlog)
[![Dependency Status](https://david-dm.org/MakeNowJust/mdlog.png)](https://david-dm.org/MakeNowJust/mdlog)


## What Is?

```javascript
require('mdlog/override');

console.log([
  '# Hello, *mdlog* World!',
  '',
  'You can use Markdown syntax on `console.log`.',
  '',
  '- Markdown is **powerfull**.',
  '- Markdown is **useful**.',
  '- Markdown is **readable**.',
  '',
  '> Markdown is a text-to-HTML conversion tool for web writers.',
  'Markdown allows you to write using an easy-to-read, easy-to-write plain text format,',
  'then convert it to structurally valid XHTML (or HTML).',
  '',
  'see <http://en.wikipedia.org/wiki/Markdown>.',
].join('\n'));
```

then terminal output is:

![output to terminal](https://raw.githubusercontent.com/MakeNowJust/mdlog/master/sample/readme-node.png)

and browser output is:

![output to browser console](https://raw.githubusercontent.com/MakeNowJust/mdlog/master/sample/readme-browser.png)


## Install

```console
$ npm install --save mdlog
```

`--save` option is optional.

## API

```javascript
mdlogBuilder = require('mdlog');
```

#### `mdlog = mdlogBuilder(colorScheme)`

`mdlogBuilder` is builder of `mdlog` function.

An argument `colorScheme` is color scheme `Object` (see [color directory](https://github.com/MakeNowJust/mdlog/tree/master/color)),
its default value is `colorScheme = require('mdlog/color/default.json')`.

It returns `mdlog` function.

- - -

#### `mdlog(markdown)`

`mdlog` output styled markdown text into `console`.

It uses `mdlogBuilder.conver` function to convert Markdown text into styled text.

It returns `undefined`.

- - -

#### `mdlogBuilder.convert(markdown, colorScheme)`

`convert` converts `markdown` text into styled text with `colorScheme`.

It uses [mdast](https://github.com/wooorm/mdast) as Markdown parser.

It returns an `Array` to pass into `console.log` as arguments.

- - -

#### `require('mdlog/override')`

`console.log` overrides `mdlog`. __This module pollutes global `console` object.__ You can use original `console.log` as `console._log`.


### License

MIT License. See <https://makenowjust.github.io/license/mit?2015>.

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