@nexssp/markdown
Version:
Basic markdown functions.. eg markdown->terminal
43 lines (25 loc) • 783 B
Markdown
* 24.04.2025 - added Typescript support
This module is experimental.
- **toTerminal** (markdownString) - Convert markdown string to the terminal with colouring..
```js
const { toTerminal } = require('@nexssp/markdown')
const testMarkdownContent = require('fs').readFileSync(`${__dirname}/test-file.md`).toString()
console.log(toTerminal(testMarkdownContent))
```
OR
```js
import { toTerminal } from '@nexssp/markdown'
import { readFileSync } from 'fs'
const testMarkdownContent = readFileSync(new URL('test-file.md', import.meta.url)).toString()
console.log(toTerminal(testMarkdownContent))
```
Example of markown for testing..
```md
This is a test markdown
<!-- See more at tests/test-file.md -->
```