The remark monorepo publishes four packages to npm. Which one you install depends on what role it will play in your pipeline: theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/remarkjs/remark/llms.txt
Use this file to discover all available pages before exploring further.
remark package covers most use cases on its own, while remark-parse and remark-stringify give you finer control when composing a custom unified processor. remark-cli is for command-line use without writing JavaScript.
All remark packages are ESM only — there is no CommonJS build. In Node.js projects, add
"type": "module" to your package.json, or use .mjs file extensions for any script that imports remark. require() will not work.Node.js (version 16+)
remark
Use remark when your input is markdown and your output is also markdown. It is a pre-configured unified processor that bundles remark-parse and remark-stringify.
remark-parse
Use remark-parse when you need to parse markdown as part of a larger unified pipeline where the output is something other than markdown (for example, HTML via rehype).
remark-stringify
Use remark-stringify when you need to serialize an mdast syntax tree back to markdown as the final step in a custom unified pipeline.
remark-cli
Use remark-cli to inspect and format markdown files from a terminal or an npm script, without writing JavaScript.
Deno
All packages are available in Deno via esm.sh. No installation step is needed — import directly in your script.remark
remark-parse
remark-stringify
Browsers
You can use remark in a modern browser by loading packages from esm.sh with the?bundle query parameter, which inlines all dependencies into a single file.
remark
remark-parse
remark-stringify
TypeScript
The remark organization and the unified collective are fully typed with TypeScript. No@types/* packages are required for remark itself — type declarations ship with every package.
Type definitions for the mdast node types (e.g. Root, Heading, Paragraph) are available from @types/mdast:
If you use
.data('settings', …) on a unified processor to pass options to remark-stringify, import remark-stringify (or remark) somewhere in your TypeScript project. Those packages register their Settings types with unified, which lets TypeScript validate the option names you pass.Verifying your installation
After installing, you can verify everything is wired up correctly by running this one-liner from a.mjs file or a project with "type": "module":