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. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
markdown-it-container publishes both a CommonJS entry and a native ESM entry (ESM added in 4.0.0). require("markdown-it-container") and import "markdown-it-container" both work on every supported Node.js version and in Bun.
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.
| Runtime | require("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 | ✓ works | ✓ works |
How to import markdown-it-container
ES modules (import)
import markdownItContainer from "markdown-it-container";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 (4 versions; the newest 4 shown).
| Versions | Format | First published |
|---|---|---|
| 4.0.0 | Dual (CommonJS + ESM) | Dec 5, 2023 |
| 1.0.0 – 3.0.0 | CommonJS | Mar 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") and import "markdown-it-container" both work on every supported Node.js version and in Bun.
Can I require markdown-it-container?
Yes. markdown-it-container ships a CommonJS entry, so require("markdown-it-container") works on every Node.js version, alongside the native ESM entry for import.
Does markdown-it-container work in Bun?
Yes. import "markdown-it-container" loaded successfully in Bun 1.4 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
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- watchify 4.0.0CommonJS
- eslint-config-standard-with-typescript 43.0.1CommonJS
- babel-preset-minify 0.5.2CommonJS
- gulp-concat 2.6.1CommonJS
- codelyzer 6.0.2CommonJS
- babel-plugin-import 1.13.8CommonJS
- karma-sourcemap-loader 0.4.0CommonJS
- rollup-plugin-babel 4.4.0CommonJS