TypeScript Bundler (tsb)
raw JSON → 1.0.1 verified Sat Apr 25 auth: no javascript
A zero-configuration TypeScript transpiler and bundler that transpiles .ts files to .js/.d.ts, bundles output with tree-shaking of side-effect-free modules, compresses public folder assets (gzip, br2, webp), mangled/prettied output, and generates package.json and settings.js from config files (JS, JSON, YAML, JSON5, INI, Properties). Version 1.0.1 on npm, requires Node >= 8.5.0. Notable: GitHub-only install, no published npm package (install via git), does not support bundling for browser. Alpha-like quality with minimal documentation.
Common errors
error Error: Cannot find module 'typescript-bundler' ↓
cause Package not available on npm; only installable from GitHub via git URL.
fix
Run 'npm i -g git+ssh://git@github.com/e2tox/tsb.git' from command line, not in package.json.
error ERR_MODULE_NOT_FOUND ↓
cause Trying to import typescript-bundler programmatically; no module exports.
fix
Use CLI only: run 'tsb' from terminal.
error tsb: command not found ↓
cause Package not installed or not in PATH.
fix
Ensure global install: 'npm i -g git+ssh://git@github.com/e2tox/tsb.git' and verify with 'which tsb'.
error SyntaxError: Unexpected token => ↓
cause Node version < 8.5.0 does not support arrow functions used in the package.
fix
Upgrade Node to 8.5.0 or higher.
Warnings
gotcha Package is installed directly from GitHub (no npm registry version). Unreliable source, may disappear if repository is private or deleted. ↓
fix Use alternative bundlers like tsup or esbuild for stable releases.
deprecated Requires Node >= 8.5.0, which is extremely outdated and unsupported. ↓
fix Upgrade Node to a modern version (18+). The package may not work on newer Node due to deprecated APIs.
gotcha No programmatic API – only CLI usage. Cannot be imported into Node scripts. ↓
fix Use subprocess to call 'tsb' CLI if integration needed, or choose a programmatic bundler.
gotcha Documentation is minimal; project structure is rigidly enforced. Non-standard folder layouts will fail silently. ↓
fix Follow exact folder structure: bin/, lib/, public/, src/, index.ts, package.json, tsconfig.json.
gotcha No support for browser bundles; output is Node.js-targeted CommonJS. Cannot be used for front-end bundling. ↓
fix Use a true front-end bundler like webpack, Vite, or esbuild for browser code.
Install
npm install typescript-bundler yarn add typescript-bundler pnpm add typescript-bundler Imports
- tsb wrong
const tsb = require('typescript-bundler');correctimport { tsb } from 'typescript-bundler'; - default import wrong
import tsb from 'typescript-bundler';correct - require wrong
const tsb = require('typescript-bundler');correct
Quickstart
// Install globally from GitHub
npm i -g git+ssh://git@github.com/e2tox/tsb.git
// Create project structure as described in README
// Example minimal setup:
mkdir my-project
cd my-project
mkdir bin lib public src
touch bin/cli.ts lib/index.ts public/index.html package.json tsconfig.json
// Add some code to bin/cli.ts:
// console.log('Hello from CLI');
// Run bundler
tsb
// Output will be in dist/ folder (default)