Version 1.0.0
@stackline/remark
unified processor with support for parsing markdown input and serializing markdown as output
Independent maintenance of remark 14.0.3. Original authors and licenses are retained.
Installation
# Preserve existing imports with an npm alias
npm install remark@npm:@stackline/remark@1.0.0
# Or use the scoped package name in your imports
npm install @stackline/remark@1.0.0Node.js: See compatibility notes. Read the compatibility and maintenance notes before migrating.
Usage and API
The reference below may retain upstream package names. Use the alias installation above to run those imports with this Stackline release.
@stackline/remark
Independent maintenance fork of remark@14.0.3, preserving its API and published type declarations.
npm install @stackline/remark
# Keep existing imports:
npm install remark@npm:@stackline/remark@1.0.0
Stackline · Issues · Community
See UPSTREAM.md for source identity and issue review, and CHANGELOG.md for maintenance changes. Functional tests also run against the final npm tarball; releases are published from GitHub Actions with provenance.
Upstream documentation
remark
unified processor with support for parsing markdown input and serializing markdown as output.
Contents
- What is this?
- When should I use this?
- Install
- Use
- API
- Examples
- Syntax
- Syntax tree
- Types
- Compatibility
- Security
- Contribute
- Sponsor
- License
What is this?
This package is a unified processor with support for parsing markdown input
and serializing markdown as output by using unified with
remark-parse and remark-stringify.
unified is a project that transforms content with abstract syntax trees (ASTs). remark adds support for markdown to unified. mdast is the markdown AST that remark uses. Please see the monorepo readme for what the remark ecosystem is.
When should I use this?
You can use this package when you want to use unified, have markdown as input,
and want markdown as output.
This package is a shortcut for
unified().use(remarkParse).use(remarkStringify).
When the input isn’t markdown (meaning you don’t need remark-parse) or the
output is not markdown (you don’t need remark-stringify), it’s recommended to
use unified directly.
When you want to inspect and format markdown files in a project on the command
line, you can use remark-cli.
Install
This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:
npm install remark
In Deno with esm.sh:
import {remark} from 'https://esm.sh/remark@14'
In browsers with esm.sh:
<script type="module">
import {remark} from 'https://esm.sh/remark@14?bundle'
</script>
Use
Say we have the following module example.js:
import {remark} from 'remark'
import remarkGfm from 'remark-gfm'
import remarkToc from 'remark-toc'
main()
async function main() {
const file = await remark()
.use(remarkGfm)
.use(remarkToc)
.process('# Hi\n\n## Table of contents\n\n## Hello\n\n*Some* ~more~ _things_.')
console.error(String(file))
}
Running that with node example.js yields:
# Hi
## Table of contents
* [Hello](#hello)
## Hello
*Some* ~~more~~ *things*.
API
This package exports the following identifier: remark.
There is no default export.
remark()
Create a new (unfrozen) unified processor that already uses remark-parse and
remark-stringify and you can add more plugins to.
See unified for more information.
Examples
Example: checking markdown
The following example checks that markdown code style is consistent and follows some best practices:
import {reporter} from 'vfile-reporter'
import {remark} from 'remark'
import remarkPresetLintConsistent from 'remark-preset-lint-consistent'
import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
main()
async function main() {
const file = await remark()
.use(remarkPresetLintConsistent)
.use(remarkPresetLintRecommended)
.process('1) Hello, _Jupiter_ and *Neptune*!')
console.error(reporter(file))
}
Yields:
1:1 warning Missing newline character at end of file final-newline remark-lint
1:1-1:35 warning Marker style should be `.` ordered-list-marker-style remark-lint
1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
1:25-1:34 warning Emphasis should use `_` as a marker emphasis-marker remark-lint
⚠ 4 warnings
Example: passing options to remark-stringify
When you use remark-stringify manually you can pass options to use.
Because remark-stringify is already used in remark, that’s not possible.
To define options for remark-stringify, you can instead pass options to
data:
import {remark} from 'remark'
main()
async function main() {
const file = await remark()
.data('settings', {bullet: '*', setext: true, listItemIndent: 'one'})
.process('# Moons of Neptune\n\n- Naiad\n- Thalassa\n- Despine\n- …')
console.log(String(file))
}
Yields:
Moons of Neptune
================
* Naiad
* Thalassa
* Despine
* …
Syntax
Markdown is parsed and serialized according to CommonMark. Other plugins can add support for syntax extensions.
Syntax tree
The syntax tree format used in remark is mdast.
Types
This package is fully typed with TypeScript. There are no extra exported types.
Compatibility
Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 12.20+, 14.14+, and 16.0+. Our projects sometimes work with older versions, but this is not guaranteed.
Security
As markdown can be turned into HTML and improper use of HTML can open you up to
cross-site scripting (XSS) attacks, use of remark can be unsafe.
When going to HTML, you will likely combine remark with rehype, in which
case you should use rehype-sanitize.
Use of remark plugins could also open you up to other attacks. Carefully assess each plugin and the risks involved in using them.
For info on how to submit a report, see our security policy.
Contribute
See contributing.md in remarkjs/.github for ways
to get started.
See support.md for ways to get help.
Join us in Discussions to chat with the community and contributors.
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!
|
Vercel |
Motif |
HashiCorp |
GitBook |
Gatsby |
|||||
Netlify
|
Coinbase |
ThemeIsle |
Expo |
Boost Note
|
Holloway |
||||
|
You? |
|||||||||
License
Upstream issues and maintenance review
Upstream and maintenance review
Independent maintenance of remark@14.0.3 as @stackline/remark.
- Source history: https://github.com/remarkjs/remark/tree/43542c3f4ff8868de2571cbd2d8e0c7e6892a014
- Original npm integrity:
sha512-bfmJW1dmR2LvaMJuAnE88pZP9DktIFYXazkTfOIKZzi3Knk9lT0roItIA24ydOucI3bV/g/tXBA6hzqq3FV9Ew==. - Issues checked: 2026-09-29T00:22:04.240592+00:00.
- Original authors, notices and license are retained. Published runtime and declaration file hashes are recorded in
.stackline/upstream.json; reviewed differences are explicitly listed there. - Original functional suites run against both source and the extracted final tarball. Type checks and the complete development/runtime audit must pass.
This maintenance branch selects the npm package from the upstream monorepo into the repository root and retains the upstream Git history. Shared tests are narrowed to this package and wired to its local implementation. Other monorepo products are not published by this repository.
Issue triage
- https://github.com/remarkjs/remark/issues/1477: The reported trailing-hard-break roundtrip is not representable as a CommonMark hard break at the end of a block. CommonMark 0.31.2 section 6.7 requires a following inline. The parser semantics are preserved; this release does not promise lossless serialization of every hand-constructed AST. See https://spec.commonmark.org/0.31.2/#hard-line-breaks.
The evidence query fetched the latest 100 open and 30 closed issue/PR entries and removed PRs. This is a bounded review, not a claim of exhaustive issue history or resolution of every issue.
Release verification
GitHub Actions publishes the reviewed passing-CI tarball. Release completion requires exact source identity, zero open CodeQL alerts, npm provenance and tarball identity, normal and aliased installs, and matching immutable GitHub release assets. Existing versions are never replaced.
Release changes
Changelog
1.0.0
- Start Stackline maintenance of the documented upstream API.
- Preserve and verify published runtime files and TypeScript declarations.
- Run upstream functional suites against both source and the final package.
- Publish the reviewed CI artifact through GitHub Actions with provenance and immutable release evidence.
Release files and references
Package bytes, npm provenance and the immutable GitHub release were verified for this version. Security checks describe the reviewed release; documented compatibility risks and upstream reports are not blanket claims of resolution.

