canirequire

canirequire › Dual (CommonJS + ESM) › markdown-it-container

Is markdown-it-container ESM-only? Can you require() it?

Plugin to create block-level custom containers for markdown-it markdown parser

Last verified Sep 9, 2026 against markdown-it-container@4.0.0. Markdown · JSON

Dual (CommonJS + ESM) Dual package — require() works on every Node.js version we test; import works too

markdown-it-container publishes both a CommonJS entry and a native ESM entry (ESM added in 4.0.0). require("markdown-it-container") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "markdown-it-container" works alongside it.

What to do

  1. Nothing to change. require("markdown-it-container") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import * as markdownItContainer from "markdown-it-container" works alongside it; use named imports for what the ESM entry exports.
  2. TypeScript: npm install -D @types/markdown-it-container
Latest
4.0.0 (Dec 5, 2023)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
4.0.0
Native ESM since
4.0.0
TypeScript types
@types/markdown-it-container
Node engines
not declared
Weekly downloads
395K
License
MIT

Does markdown-it-container@4.0.0 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("markdown-it-container") from a CommonJS file and import "markdown-it-container" from an ES module.

Runtimerequire("markdown-it-container")import "markdown-it-container"
Node.js 18✓ works✓ works
Node.js 20✓ works✓ works
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4.0✓ works✓ works

How to import markdown-it-container

ES modules (import)

import * as markdownItContainer from "markdown-it-container";

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS (require)

const markdownItContainer = require("markdown-it-container");

Module format by version

Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (4 versions; the newest 4 shown).

VersionsFormatFirst published
4.0.0Dual (CommonJS + ESM)Dec 5, 2023
1.0.0 – 3.0.0CommonJSMar 13, 2015

Frequently asked

Is markdown-it-container ESM-only?

markdown-it-container@4.0.0 ships CommonJS and ESM builds. markdown-it-container publishes both a CommonJS entry and a native ESM entry (ESM added in 4.0.0). require("markdown-it-container") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. import "markdown-it-container" works alongside it.

Can I require markdown-it-container?

Yes. markdown-it-container ships a CommonJS entry alongside the native ESM entry. require("markdown-it-container") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun.

Does markdown-it-container work in Bun?

Yes. import "markdown-it-container" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

Does markdown-it-container ship TypeScript types?

Not bundled. Install the community types with "npm install -D @types/markdown-it-container".

Links

Other dual (commonjs + esm) packages

Similar popularity