# essential-md

> An essential markdown-like utility for console logs

Latest version **0.4.0** (published 2024-07-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install essential-md
pnpm add essential-md
yarn add essential-md
bun add essential-md
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2024-07-19 |
| First published | 2020-01-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Andrea Giammarchi |
| Maintainers | webreflection |
| Keywords | markdown, console, essential |

## Links

- npm: https://www.npmjs.com/package/essential-md
- Repository: https://github.com/WebReflection/essential-md
- Homepage: https://github.com/WebReflection/essential-md#readme
- Issues: https://github.com/WebReflection/essential-md/issues
- npm.io page: https://npm.io/package/essential-md

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.4.0 (latest) — 2024-07-19
- 0.3.1 — 2020-06-02
- 0.3.0 — 2020-03-21
- 0.2.1 — 2020-01-26
- 0.2.0 — 2020-01-26
- 0.1.1 — 2020-01-24
- 0.1.0 — 2020-01-17
- 0.0.0 — 2020-01-17

## README

# essential-md

[![Build Status](https://travis-ci.com/WebReflection/essential-md.svg?branch=master)](https://travis-ci.com/WebReflection/essential-md) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/essential-md/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/essential-md?branch=master)

<sup>**Social Media Photo by [Anastasiia Kamil](https://unsplash.com/@nastyakamil) on [Unsplash](https://unsplash.com/)**</sup>

A minimalistic markdown like utility to log:

  * headers
  * bold text
  * underlined text
  * dimmed text
  * striked text
  * lists of items
  * quotes
  * multi or single line code, to keep its content unaffected
  * clear 1 up to N previous lines
  * prompt to ask questions (for anything fancier, see [prompts](https://www.npmjs.com/package/prompts))

## API

Every exported method can be used either as function or as template literal tag.

  * `emd` to transform content into a string
  * `log` to convert and `console.log(...)` the result right away
  * `error` to `console.error` a bold red `Error:` in front of the message
  * `info` to `console.info` a bold blue `Info:` in front of the message
  * `warn` to `console.warn` a bold yellow `Warning:` in front of the message
  * `clear` to clear any previous logged line (`clear(1)`, `clear(7)`, ... default `1`)
  * `prompt` to ask questions (`prompt('What is your name?').then(...)`)
  * `ok` to `console.log` a bold green `OK:` in front of the message
  * `blue`, `green`, `red`, and `yellow`, to easily color some part of the text

## Examples

```js
import {log, green, red} from 'essential-md';
// const {log, green, red} = require('essential-md');

log`
# This is a header

With some extra content, plus:

  * a ${green`green`} text
  * a ${red`red`} text

... and literally **nothing else**
`;
```

## The `essential-md` Markdown flavour

  * `# header` or `#header#` to have top header
  * `## header` or `## header ##` to have less relevant headers
  * `*bold*` or `**bold**` to have bold text
  * `_underlined_` or `__underlined__` to have underlined text
  * `-dim-` or `--dim--` to have dimmed text (not on Windows though, Windows doesn't understand dimmed text ...)
  * `~strike~` or `~~strike~~` to strike the text
  * `'''` or 3 backticks to have multi-line code
  * single backtick to have inline code
  * a line starting with a space and one of these `*+-.` chars to have lists
  * a line starting with `>` to quote text

That's all folks!

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