0.4.0 • Published 1 year ago
essential-md v0.4.0
essential-md
Social Media Photo by Anastasiia Kamil on Unsplash
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)
API
Every exported method can be used either as function or as template literal tag.
emdto transform content into a stringlogto convert andconsole.log(...)the result right awayerrortoconsole.errora bold redError:in front of the messageinfotoconsole.infoa bold blueInfo:in front of the messagewarntoconsole.warna bold yellowWarning:in front of the messageclearto clear any previous logged line (clear(1),clear(7), ... default1)promptto ask questions (prompt('What is your name?').then(...))oktoconsole.loga bold greenOK:in front of the messageblue,green,red, andyellow, to easily color some part of the text
Examples
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
# headeror#header#to have top header## headeror## 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!