canirequire › ESM-only › tsdx
Is tsdx ESM-only? Can you require() it?
Zero-config TypeScript package development
Last verified Sep 9, 2026 against tsdx@2.0.0. JSON
ESM-only ESM-only since 2.0.0 — last CommonJS version is 0.14.1
tsdx dropped its CommonJS build in 2.0.0 (December 2025). The last version you can require() on every Node.js version, including 18 and older, is 0.14.1, published Oct 13, 2020.
require("tsdx") failed in our probe on Node.js 20+ as well. See the runtime matrix below for the exact error.
tsdx@2.0.0 declares engines ">=20", so Node.js 18 is outside its supported range regardless of module format.
Does tsdx@2.0.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("tsdx") from a CommonJS file and import "tsdx" from an ES module.
| Runtime | require("tsdx") | import "tsdx" |
|---|---|---|
| Node.js 18 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsUsage: tsdx [options] [command] |
| Node.js 20 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsUsage: tsdx [options] [command] |
| Node.js 22 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsUsage: tsdx [options] [command] |
| Node.js 24 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsUsage: tsdx [options] [command] |
| Node.js 26 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✗ failsUsage: tsdx [options] [command] |
| Bun 1.4 | ✗ failserror: Cannot find package 'tsdx' from '/Users/boat/Projects/top-seo/data/probe-work/tsdx/req.cjs' | ✗ failsUsage: tsdx [options] [command] |
How to import tsdx
ES modules (import)
import tsdx from "tsdx";CommonJS (require)
// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const tsdx = require("tsdx");
// Any Node.js version:
const tsdx = await import("tsdx");
// Or pin the last CommonJS release:
// npm install tsdx@0.14.1Module format by version
Derived from the type, main and exports fields of every stable release on npm (56 versions; the newest 56 shown).
| Versions | Format | First published |
|---|---|---|
| 2.0.0 | ESM-only | Dec 29, 2025 |
| 0.1.0 – 0.14.1 | CommonJS | Jan 24, 2019 |
Frequently asked
Is tsdx ESM-only?
tsdx@2.0.0 is ESM-only. tsdx dropped its CommonJS build in 2.0.0 (December 2025). The last version you can require() on every Node.js version, including 18 and older, is 0.14.1, published Oct 13, 2020.
Which version of tsdx still supports CommonJS / require()?
0.14.1 is the last version of tsdx with a CommonJS build. Install it with "npm install tsdx@0.14.1". Every version from 2.0.0 on is ESM-only.
How do I use tsdx from a CommonJS file?
Use a dynamic import: const mod = await import("tsdx"). On Node.js 20.19+, 22.12+ and newer, a plain require("tsdx") also works for ESM packages that do not use top-level await. Alternatively pin tsdx@0.14.1.
Does tsdx work in Bun?
Importing tsdx failed in Bun 1.4 on Sep 9, 2026: Usage: tsdx [options] [command]
Does tsdx ship TypeScript types?
Yes. tsdx bundles its own type declarations; no @types package is needed.
Links
Other esm-only packages
- ansi-styles 7.0.0last CJS
5.2.0 - strip-ansi 7.2.0last CJS
6.0.1 - commander 15.0.0last CJS
14.0.3 - supports-color 11.0.0last CJS
8.1.1 - chalk 6.0.0last CJS
4.1.2 - tslib 2.8.1last CJS
2.5.2 - string-width 8.2.2last CJS
4.2.3 - ansi-regex 6.3.0last CJS
5.0.1
Similar popularity
- @oclif/dev-cli 1.26.10CommonJS
- rollup-plugin-serve 3.0.0Dual
- ember-disable-prototype-extensions 1.1.3CommonJS
- gulp-minify-css 1.2.4CommonJS
- jasmine-node 3.0.0CommonJS
- karma-browserify 8.1.0CommonJS
- dumi 2.4.49CommonJS
- babel-preset-latest 6.24.1CommonJS