Registry / serialization / remarkable

remarkable

JSON →
library0.3.1jsnpmunverified

Remarkable is a fast, extensible Markdown parser for JavaScript, offering 100% CommonMark specification support, alongside syntax extensions and typographer features. Currently at version 2.0.1, the library provides a robust solution for converting Markdown strings to HTML. Its key differentiators include high performance, a highly configurable parsing engine that allows adding or replacing syntax rules, and a vibrant community plugin ecosystem available via npm. Version 2.0.0 introduced significant changes, including a migration to ES module source code, rollup-based bundling for UMD, CJS, and ESM formats, and a shift to named exports for its public API. The project maintains an active development status, with updates focusing on stability and modern JavaScript practices.

npm install remarkable
INSTALL
IMPORT
SIG · REMARKABLE
R
remarkable
serializationjavascriptv0.3.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Remarkable
✓ import { Remarkable } from 'remarkable';
✗ import Remarkable from 'remarkable';
Since v2.0.0, Remarkable's public API uses named exports for better ESM/CJS interop. The default export was removed.
Remarkable (CommonJS)
✓ const { Remarkable } = require('remarkable');
✗ const Remarkable = require('remarkable');
For CommonJS environments, ensure to destructure the named export as the default export was removed in v2.0.0.
RemarkablePresets
✓ const md = new Remarkable('commonmark');
Presets like 'commonmark' or 'full' can be passed as a string argument to the Remarkable constructor to quickly apply common configurations.

Demonstrates basic usage of the Remarkable parser, including default rendering, applying the 'commonmark' preset, and configuring options via the constructor to enable features like HTML tags, line breaks, and typographer rules.

import { Remarkable } from 'remarkable'; // Initialize Remarkable with default settings (similar to GFM, but HTML disabled) const md = new Remarkable(); // Render a basic Markdown string to HTML const markdownString = '# Hello, Remarkable!\n\nThis is a *simple* paragraph.'; const htmlOutput = md.render(markdownString); console.log('--- Default Rendering ---'); console.log(htmlOutput); // Expected output: <h1>Hello, Remarkable!</h1><p>This is a <em>simple</em> paragraph.</p> // Demonstrate a common preset: 'commonmark' const mdCommonMark = new Remarkable('commonmark'); const commonMarkOutput = mdCommonMark.render('1. Ordered list item\n\n- Unordered list item'); console.log('\n--- CommonMark Preset Rendering ---'); console.log(commonMarkOutput); // Demonstrate setting options via constructor const mdWithOptions = new Remarkable({ html: true, // Enable HTML tags in source breaks: true, // Convert '\n' in paragraphs into <br> typographer: true // Enable smart quotes and other typographic improvements }); const complexMarkdown = ` # Markdown with Options <p>This is an HTML paragraph.</p> Line one. Line two. "Smart quotes" should be enabled. `; const complexHtmlOutput = mdWithOptions.render(complexMarkdown); console.log('\n--- Rendering with Custom Options ---'); console.log(complexHtmlOutput);
Debug
Known issues
breakingThe default import `import Remarkable from 'remarkable'` was removed in v2.0.0. The library now exclusively uses named exports for its public API.
fix
Change `import Remarkable from 'remarkable'` to `import { Remarkable } from 'remarkable'` for ESM, or `const { Remarkable } = require('remarkable');` for CommonJS.
affects: >=2.0.0
breakingThe internal `lib` directory is no longer published or considered part of the public API since v2.0.0. Direct imports from `remarkable/lib/...` are unsupported and will break.
fix
Rely solely on the public API of the `remarkable` package by importing directly from `remarkable`. Avoid accessing internal paths.
affects: >=2.0.0
breakingBower support was officially removed in v2.0.0 due to its deprecation in modern web development workflows.
fix
Migrate package management to npm or Yarn. Install Remarkable using `npm install remarkable` or `yarn add remarkable`.
affects: >=2.0.0
gotchaModifying a `Remarkable` instance on the fly using `md.set()` can negatively impact performance. For optimal speed, it is recommended to create separate instances for different configurations.
fix
Instead of `md.set({ /* options */ })`, create a new instance: `const mdConfigured = new Remarkable({ /* options */ });`.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Remarkable is not a constructor
Attempting to instantiate `Remarkable` using a default import or incorrect CommonJS require after the v2.0.0 breaking change to named exports.
fix
For ESM, use `import { Remarkable } from 'remarkable';`. For CommonJS, use `const { Remarkable } = require('remarkable');`.
ERR_MODULE_NOT_FOUND: Cannot find module 'remarkable/lib/some-internal-module'
Attempting to import from the internal `lib` directory, which is no longer published or supported since v2.0.0.
fix
Only import directly from the main `remarkable` package (`import { Remarkable } from 'remarkable';`). Internal modules are not part of the public API.
Upgrade
Version history
0.3.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
remarkable — npm install remarkable · libregistry