node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »

remark

remark Build Status Coverage Status Chat

The remark processor is a markdown processor powered by plug-ins.

Don’t need the parser? Or the compiler? That’s OK.

Installation

npm:

npm install remark

Usage

var remark = require('remark');
var recommended = require('remark-preset-lint-recommended');
var html = require('remark-html');
var report = require('vfile-reporter');
 
remark()
  .use(recommended)
  .use(html)
  .process('## Hello world!', function (err, file) {
    console.error(report(err || file));
    console.log(String(file));
  });

Yields:

1:1  warning  Missing newline character at end of file  final-newline  remark-lint
 
⚠ 1 warning
<h2>Hello world!</h2>

License

MIT © Titus Wormer