canirequire

canirequireESM-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.

Latest
2.0.0 (Dec 29, 2025)
Module format
ESM-only
Last CommonJS version
0.14.1
ESM-only since
2.0.0 (Dec 29, 2025)
TypeScript types
Bundled
Node engines
>=20
Weekly downloads
49K
License
MIT

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.

Runtimerequire("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.1

Module format by version

Derived from the type, main and exports fields of every stable release on npm (56 versions; the newest 56 shown).

VersionsFormatFirst published
2.0.0ESM-onlyDec 29, 2025
0.1.0 – 0.14.1CommonJSJan 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

Similar popularity