remark
Markdown processor powered by plugins part of the unified collective
Last updated 4 years ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install remark 
SYNC missed versions from official npm registry.

remark

Build Coverage Downloads Size Sponsors Backers Chat

unified processor to parse and serialize Markdown. Built on micromark. Powered by plugins. Part of the unified collective.

Don’t need the parser? Or compiler? That’s OK: use unified directly.

Install

npm:

npm install remark

Use

See unified for more examples »

Common example

This example lints Markdown and turns it into HTML.

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>
Settings through data

This example prettifies Markdown and configures remark-parse and remark-stringify through data.

var remark = require('remark')

remark()
  .data('settings', {emphasis: '*', strong: '*'})
  .process('_Emphasis_ and __importance__', function (err, file) {
    if (err) throw err
    console.log(String(file))
  })

Yields:

*Emphasis* and **importance**
Settings through a preset

This example prettifies Markdown and configures remark-parse and remark-stringify through a preset.

var remark = require('remark')

remark()
  .use({settings: {emphasis: '*', strong: '*'}})
  .process('_Emphasis_ and __importance__', function (err, file) {
    if (err) throw err
    console.log(String(file))
  })

Yields:

*Emphasis* and **importance**

API

See unified for API docs »

Security

As Markdown is sometimes used for HTML, and improper use of HTML can open you up to a cross-site scripting (XSS) attack, use of remark can also be unsafe. When going to HTML, use remark in combination with the rehype ecosystem, and use rehype-sanitize to make the tree safe.

Use of remark plugins could also open you up to other attacks. Carefully assess each plugin and the risks involved in using them.

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help. Ideas for new plugins and tools can be posted in remarkjs/ideas.

A curated list of awesome remark resources can be found in awesome remark.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

Sponsor

Support this effort and give back by sponsoring on OpenCollective!

Gatsby 🥇

Vercel 🥇

Netlify

Holloway

ThemeIsle

BoostIO

Expo


You?

License

MIT © Titus Wormer

Current Tags

  • 15.0.1                                ...           latest (a year ago)
  • 13.0.0-alpha.1                                ...           next (4 years ago)

49 Versions

  • 15.0.1                                ...           a year ago
  • 15.0.0                                ...           a year ago
  • 14.0.3                                ...           2 years ago
  • 14.0.2                                ...           3 years ago
  • 14.0.1                                ...           3 years ago
  • 14.0.0                                ...           3 years ago
  • 13.0.0                                ...           4 years ago
  • 13.0.0-alpha.1                                ...           4 years ago
  • 13.0.0-alpha.0                                ...           4 years ago
  • 12.0.1                                ...           4 years ago
  • 12.0.0                                ...           5 years ago
  • 11.0.2                                ...           5 years ago
  • 11.0.1                                ...           5 years ago
  • 11.0.0                                ...           5 years ago
  • 10.0.1                                ...           6 years ago
  • 10.0.0                                ...           6 years ago
  • 9.0.0                                ...           7 years ago
  • 8.0.0                                ...           7 years ago
  • 7.0.1                                ...           8 years ago
  • 7.0.0                                ...           8 years ago
  • 6.2.0                                ...           8 years ago
  • 6.0.1                                ...           8 years ago
  • 6.0.0                                ...           8 years ago
  • 5.1.0                                ...           8 years ago
  • 5.0.1                                ...           9 years ago
  • 5.0.0                                ...           9 years ago
  • 4.2.2                                ...           9 years ago
  • 4.2.1                                ...           9 years ago
  • 4.2.0                                ...           9 years ago
  • 4.1.2                                ...           9 years ago
  • 4.1.1                                ...           9 years ago
  • 4.1.0                                ...           9 years ago
  • 4.0.0                                ...           9 years ago
  • 4.0.0-alpha.4                                ...           9 years ago
  • 4.0.0-alpha.3                                ...           9 years ago
  • 4.0.0-alpha.2                                ...           9 years ago
  • 4.0.0-alpha.1                                ...           9 years ago
  • 3.2.3                                ...           9 years ago
  • 3.2.2                                ...           9 years ago
  • 3.2.1                                ...           9 years ago
  • 3.2.0                                ...           9 years ago
  • 3.1.3                                ...           9 years ago
  • 3.1.2                                ...           9 years ago
  • 3.1.1                                ...           9 years ago
  • 3.1.0                                ...           9 years ago
  • 3.0.1                                ...           9 years ago
  • 3.0.0                                ...           9 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Maintainers (2)
Downloads
Total 3
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE