remark parses and compiles markdown. It lets programs process markdown without ever compiling to HTML (it can though) by creating a syntax tree. This enables code analysis (e.g., remark-lint), code transformation (e.g., remark-toc), and code generation (built in).

It aims to do for markdown what esprima did for javascript and PostCSS for css: bring markdown into the tooling age.

remark has lots of tests (800+), great coverage (100%), a free license, sensible code style (eslint, jscs), internal documentation.

GitHub »

Demo »


The Command Line Interface is powerful, it supports all settings the API provides and has built-in support for regenerating markdown files in a project according to a given style-guide, and emits warnings triggered by plug-ins in a beautiful fashion.

Settings and plug-ins can be provided through cascading configuration files (.remarkrc or an "remarkConfig" property in package.json files).

CLI docs »


Require dependencies:

const remark = require('remark');
const yamlConfig = require('remark-yaml-config');

Use a plugin. remark-yaml-config allows settings in YAML frontmatter:

const processor = remark().use(yamlConfig);

Parse, modify, and stringify the document:

const doc = processor.process(`---
  commonmark: true

2) Some *emphasis*, **strongness**, and `code`.


  commonmark: true

2.  Some _emphasis_, **strongness**, and `code`.

The Application Programming Interface is the gist of remark and the CLI. The API allows advanced markdown processing through several parsing and stringification settings.

remark understand multiple flavours of markdown (GitHub Flavoured, CommonMark, and more) and generates documents based on provided style settings (list bullets, syntax markers, indentation, and more).

API docs »


Code Transformation




Plug-ins are the core of remark. As noted earlier, they analyse, transform, configure, and generate documents based on given settings.

To use plugins on the CLI, use the --use or -u key:

npm install --global remark remark-lint
remark --use remark-lint

In the API, use the use() function:

const remark = require('remark');
const lint = require('remark-lint');
const processor = remark().use(lint);

It’s also easy to create plug-ins yourself. Read how to do that in the docs.

Plug-in docs »