Registry / devops / typack

typack

JSON →
library0.3.0jsnpmunverified

A native TypeScript declaration (.d.ts) bundler built on Oxc, providing fast bundling of TypeScript declaration files. Current stable version is 0.3.0, released periodically on npm. It differentiates from other d.ts bundlers (like @microsoft/api-extractor or dts-bundle-generator) by leveraging Oxc's performance for native-speed parsing and bundling. It supports external module exclusion, sourcemaps, and CJS default export emission. Requires Node.js >= 20.

npm install typack
INSTALL
IMPORT
SIG · TYPACK
T
typack
devopsjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bundle
✓ import { bundle } from 'typack'
✗ const { bundle } = require('typack')
typack is ESM-only; use named import. CommonJS require() will not work.
BundleDtsResult
✓ import type { BundleDtsResult } from 'typack'
✗ import { BundleDtsResult } from 'typack'
BundleDtsResult is a type; import it with `import type` or use `import { type BundleDtsResult }`.
BundleOptions
✓ import type { BundleOptions } from 'typack'
✗ import { BundleOptions } from 'typack'
BundleOptions is a type; import it with `import type`.

Bundles a TypeScript declaration file, externalizing 'react', with sourcemap generation.

import { bundle } from 'typack'; const result = bundle({ input: ['src/index.d.ts'], external: ['react'], cwd: process.cwd(), sourcemap: true, cjsDefault: false, }); console.log(result.code); if (result.map) { console.log('Source map generated'); } result.warnings.forEach(w => console.warn(w.message));
Debug
Known issues
breakingNode.js >= 20 is required. Lower versions are not supported.
fix
Upgrade Node.js to version 20 or higher.
affects: <0.0.0
gotchaThe package is ESM-only. CommonJS require() will throw an error.
fix
Use import syntax or set your project to ESM mode.
affects: >=0.0.1
gotchaThe 'input' option accepts an array of strings, but passing a single string (e.g., 'src/index.d.ts') is a common mistake.
fix
Always wrap the entry file in an array: input: ['src/index.d.ts'].
affects: >=0.0.1
deprecatedThe 'cjsDefault' option may be deprecated in future versions as ESM becomes standard.
fix
Avoid relying on CJS-specific output; prefer ESM default exports.
affects: >=0.3.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/typack/dist/index.js not supported.
Using CommonJS require() to import an ESM-only package.
fix
Change to import { bundle } from 'typack'; or add "type": "module" in package.json.
TypeError: bundle is not a function
Incorrect import (e.g., using default import instead of named import).
fix
Use import { bundle } from 'typack';
Error: Cannot find module 'typack'
Package not installed or Node.js version below 20.
fix
Run npm install typack and ensure Node.js >= 20.
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
14
Resources
packagetypack ↗
typack — npm install typack · libregistry