https://github.com/ziv/marked-terminal-renderer
https://github.com/ziv/marked-terminal-renderer
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ziv/marked-terminal-renderer
- Owner: ziv
- License: mit
- Created: 2021-06-12T10:28:24.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-16T04:07:47.000Z (over 3 years ago)
- Last Synced: 2025-04-12T19:08:05.928Z (about 1 year ago)
- Language: TypeScript
- Size: 2.2 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# marked-terminal-renderer
Terminal renderer [marked](https://github.com/markedjs/marked) extension.
[](https://github.com/ziv/marked-terminal-renderer/actions/workflows/main.yml)
[](https://github.com/ziv/marked-terminal-renderer/actions/workflows/codeql-analysis.yml)
## Install
```shell
npm i marked-terminal-renderer
```
## Usage
### Typescript
```typescript
import terminalRenderer from 'marked-terminal-renderer';
import * as marked from 'marked';
import { readFileSync } from 'fs';
marked.use(terminalRenderer());
const src = readFileSync(__dirname + 'example.md').toString();
console.log(marked(src));
```
### ESM
```javascript
import terminalRenderer from 'marked-terminal-renderer';
import marked from 'marked';
import { readFileSync } from 'fs';
marked.use(terminalRenderer());
// there is no __dirname in ESM (this is not a node environment)
const src = readFileSync(new URL('example.md', import.meta.url)).toString();
console.log(marked(src));
```
### Examples
```shell
node examples/example.mjs
```
Output:

## Options
TBW
## Features
* Colors - thanks to [chalk](https://github.com/chalk/chalk)
* Tables - thanks to [cli-table3](https://github.com/cli-table/cli-table3)
* Wrapping - thanks to [word-wrap](https://github.com/jonschlinkert/word-wrap)
* Code Highlighting - thanks to [cli-highlight](https://github.com/felixfbecker/cli-highlight)
* Emoji - thanks to [node-emoji](https://github.com/omnidan/node-emoji)
[](https://www.npmjs.com/package/marked-terminal-renderer)
[](https://github.com/semantic-release/semantic-release)
:)