canirequire โบ Dual (CommonJS + ESM) โบ ts-api-utils
Is ts-api-utils ESM-only? Can you require() it?
Utility functions for working with TypeScript's API. Successor to the wonderful tsutils. ๐ ๏ธ๏ธ
Last verified Sep 9, 2026 against ts-api-utils@2.5.0. Markdown ยท JSON
Dual (CommonJS + ESM) Dual package on paper โ require() failed in our runtime test
ts-api-utils declares both a CommonJS entry and a native ESM entry (ESM added in 0.0.18), but require("ts-api-utils") failed on every Node.js version in our probe: TypeError: Cannot read properties of undefined (reading 'Intrinsic'). That usually means a missing peer dependency, a browser-only global, or a package that refuses to be loaded with require(); see the runtime table below.
What to do
- require("ts-api-utils") failed in our probe on every Node.js version (TypeError: Cannot read properties of undefined (reading 'Intrinsic')); check the package README for peer dependencies or setup before relying on it.
- TypeScript: types are bundled; install nothing extra.
Does ts-api-utils@2.5.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("ts-api-utils") from a CommonJS file and import "ts-api-utils" from an ES module.
| Runtime | require("ts-api-utils") | import "ts-api-utils" |
|---|---|---|
| Node.js 18 | โ failsTypeError | โ failsTypeError |
| Node.js 20 | โ failsTypeError | โ failsTypeError |
| Node.js 22 | โ failsTypeError | โ failsTypeError |
| Node.js 24 | โ failsTypeError | โ failsTypeError |
| Node.js 26 | โ failsTypeError | โ failsTypeError |
| Bun 1.4.0 | โ failsTypeError | โ failsTypeError |
A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.
How to import ts-api-utils
ES modules (import)
import * as tsApiUtils from "ts-api-utils";Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.
CommonJS (require)
// require("ts-api-utils") failed in our probe on every Node.js version we test (TypeError: Cannot read properties of undefined (reading 'Intrinsic')); see the runtime table.
const tsApiUtils = require("ts-api-utils");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 (50 versions; the newest 50 shown).
| Versions | Format | First published |
|---|---|---|
| 0.0.18 โ 2.5.0 | Dual (CommonJS + ESM) | Feb 7, 2023 |
Frequently asked
Is ts-api-utils ESM-only?
ts-api-utils@2.5.0 declares CommonJS and ESM builds, but require() fails at runtime. ts-api-utils declares both a CommonJS entry and a native ESM entry (ESM added in 0.0.18), but require("ts-api-utils") failed on every Node.js version in our probe: TypeError: Cannot read properties of undefined (reading 'Intrinsic'). That usually means a missing peer dependency, a browser-only global, or a package that refuses to be loaded with require(); see the runtime table below.
Can I require ts-api-utils?
Not in practice. ts-api-utils declares a CommonJS entry, but require("ts-api-utils") failed on every Node.js version in our probe: TypeError: Cannot read properties of undefined (reading 'Intrinsic'). Check the package README for peer dependencies or setup before relying on it.
Does ts-api-utils work in Bun?
Importing ts-api-utils failed in Bun 1.4.0 on Sep 9, 2026: TypeError: undefined is not an object (evaluating 'ts9.TypeFlags.Intrinsic')
Does ts-api-utils ship TypeScript types?
Yes. ts-api-utils bundles its own type declarations; no @types package is needed.
Links
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- tslib 2.8.1Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
Similar popularity
- merge-descriptors 2.0.0CommonJS
- @rolldown/pluginutils 1.0.1ESM-only
- is-plain-obj 4.1.0ESM-only
- require-directory 2.1.1CommonJS
- whatwg-mimetype 5.0.0CommonJS
- @eslint/eslintrc 3.3.7Dual
- proxy-from-env 2.1.0Dual
- doctrine 3.0.0CommonJS