Repository navigation
remove-markdown 0.7.0
remove-markdown 0.7.0: CommonJS, native ESM, and Deno support
remove-markdown 0.7.0 modernizes how the package can be loaded while preserving the CommonJS API used by existing applications.
The package now supports CommonJS and ES modules in Node.js, native browser ES modules, and Deno 2 through npm compatibility. It also ships module-specific TypeScript declarations and an explicit export map for predictable resolution across runtimes and tooling.
Highlights
- Native ES module support for Node.js and browsers
- Existing CommonJS usage remains supported and behavior-compatible
- Deno 2 support through
npm:remove-markdown - Matching TypeScript declarations for CommonJS and ESM consumers
- Explicit package exports for the root API, established deep imports, declarations, metadata, README, and license
- Browser-aware and Node-aware entry selection
- No runtime dependencies
Usage
CommonJS
Existing CommonJS consumers can continue using the package without changing their imports:
const removeMarkdown = require('remove-markdown');
const plainText = removeMarkdown('# A **Markdown** heading');
// A Markdown headingNode.js ES modules
ESM projects can use a native default import:
import removeMarkdown from 'remove-markdown';
const plainText = removeMarkdown('# A **Markdown** heading');
// A Markdown headingBrowser ES modules
The ESM entry is self-contained, so it can be loaded directly from a CDN that serves JavaScript with the correct MIME type. Pin browser imports to a version you have tested:
<script type="module">
import removeMarkdown from 'https://unpkg.com/remove-markdown@0.7.0/index.mjs';
const plainText = removeMarkdown('# A **Markdown** heading');
</script>Deno 2
Deno users can import the npm package directly:
import removeMarkdown from 'npm:remove-markdown@^0.7.0';
const plainText = removeMarkdown('# A **Markdown** heading');
// A Markdown headingThere is no separate JSR package. Direct imports from raw GitHub URLs are not supported because those URLs do not reliably use the required JavaScript MIME type.
Compatibility and migration
No application-level migration is expected for existing CommonJS users. The implementation and callable default API remain compatible with 0.6.4, and established imports such as remove-markdown/index and remove-markdown/index.js remain available.
The package exposes one callable default export. Named exports are not part of the API.
Node package imports retain CommonJS/ESM function identity through a Node-specific compatibility entry. Browser-aware tools select the self-contained ESM implementation instead. A generation check keeps the CommonJS and ESM implementations synchronized.
Release hardening
The 0.7 release went through two prerelease candidates:
0.7.0-rc.0introduced dual CommonJS/ESM packaging and Deno support.- Community testing found that its thin ESM wrapper depended on Node's CommonJS interoperability and therefore failed when
index.mjswas loaded directly by a browser or URL-based module loader. 0.7.0-rc.1made the ESM entry self-contained, added explicit native-module regression coverage, and completed a multi-day soak without additional compatibility reports.
That prerelease feedback prevented the browser-loading problem from reaching npm's latest tag.
Validation
The 0.7 release process included:
- the existing 39-test behavior suite
- CommonJS, ESM, and packed-tarball tests on Node.js 18, 20, 22, 24, and 26
- native unbundled browser and HTTP URL-module imports
- Deno 2 source, URL-module, and packed npm-package tests
- TypeScript NodeNext consumers and Are the Types Wrong validation
- esbuild, Rollup, and Vite browser-targeted consumers
- npm, pnpm, Yarn Plug'n'Play, and Bun installs
- 11,165 representative and generated input/option combinations, comparing both new entry points with published 0.6.4 behavior
- downstream builds and test suites for representative CommonJS and ESM projects
- zero production audit findings
Scope
This release changes module packaging and runtime compatibility. It does not include the performance work tracked in #118, which remains separate so it can be evaluated independently.
Credits
ESM and Deno support was originally proposed in #116 by @tukkek. The replacement implementation landed in #119, with browser-native ESM hardening in #122.
Thanks to everyone who tested the prereleases and reported compatibility findings before the stable rollout.
Post-ready announcement
remove-markdown 0.7.0 is ready. This release adds native ESM and Deno 2 support while preserving the CommonJS API existing applications already use. It also includes matching TypeScript declarations, explicit package exports, and a self-contained browser ESM build.
We tested the release across Node.js 18–26, Deno, major package managers, TypeScript, browser bundlers, native URL imports, and representative downstream projects. A problem found during the first release candidate was fixed in RC.1 and soaked before promotion, so npm's latest users were never exposed to it.
Install or upgrade with:
npm install remove-markdown@0.7.0Full comparison: 0.6.4...0.7.0