tslib

The runtime library that houses TypeScript's compiler helper functions so your emitted code stays small.

Library
npm
v2.8.1
1,342stars
0BSD

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
58/100Fair
Development Activity28
Maintenance32
Community84
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture85
Code Quality78
Innovation82
Learning Curve85

tslib is Microsoft’s runtime library containing every helper function the TypeScript compiler would otherwise inline into each emitted file - things like __extends, __assign, __awaiter, __decorate, and __spreadArray. When you enable the importHelpers compiler flag, TypeScript emits a single require(“tslib”) reference instead of redeclaring these helpers in every module.

The result is smaller output on average and less duplicated runtime code across a project or bundle. tslib ships in UMD, ES module, and native .mjs formats with full type declarations, has zero runtime dependencies, and is one of the most widely depended-upon packages in the JavaScript ecosystem.

What You Get

  • A single shared copy of all TypeScript helper functions (__extends, __assign, __awaiter, __decorate, __spreadArray, and more) instead of duplicated inline declarations in every emitted module.
  • Multiple distribution formats - UMD (tslib.js), ES modules (tslib.es6.js), and native ESM (tslib.es6.mjs) with a modules/ named-export layer - resolved automatically via the package.json exports map.
  • Complete TypeScript type declarations (tslib.d.ts) with JSDoc on every helper, so tooling and editors understand the runtime.
  • Zero runtime dependencies and a tree-shakeable, side-effect-free package that bundlers can prune down to only the helpers you actually use.

Common Use Cases

  • Reducing bundle size in libraries and applications by enabling importHelpers so helper code is shared rather than inlined per file.
  • Shipping npm libraries that downlevel modern syntax without bloating consumers with repeated helper boilerplate.
  • Providing the runtime helpers required by frameworks like Angular, which depend on tslib for their compiled output.
  • Standardizing helper emission across a large TypeScript monorepo so every package references one shared implementation.

Under The Hood

Architecture

tslib is organized around a single hand-authored source of truth: tslib.js defines every helper (__extends, __assign, __awaiter, __generator, __spreadArray, __decorate, __classPrivateFieldGet, __addDisposableResource, and the rest) inside a UMD wrapper that works under CommonJS, AMD, and global script loading. Parallel builds - tslib.es6.js and tslib.es6.mjs - expose the same helpers as ES modules, and a thin modules/index.js layer destructures the default export into individually named ESM exports so bundlers can tree-shake. The package.json exports map routes Node ESM, bundler module resolution, and legacy require() consumers to the correct artifact, while tslib.d.ts supplies types for all formats.

Tech Stack

The library is written in plain JavaScript and TypeScript declarations with zero runtime dependencies. It ships UMD, ESM, and native .mjs formats plus a complete .d.ts, coordinated through the package.json exports field and the sideEffects:false flag that marks it safe to prune. There is no heavy build toolchain - the distributed files are the source - and the code deliberately mirrors the helpers the TypeScript compiler emits so the two stay in lockstep.

Code Quality

Correctness is validated through integration tests rather than unit tests: the test/ directory runs the package through real consumers - Node ESM (exportStructure.test.js, rewriteRelativeImportExtension.test.js), plus webpack, rollup, and vite fixtures orchestrated by runTests.js - to confirm every module format resolves and every export is reachable across bundlers. Helper names follow TypeScript’s own emit conventions exactly, and each is documented with JSDoc in tslib.d.ts, keeping the public surface predictable.

API Design

The developer experience is intentionally invisible: users never call tslib helpers directly. Enabling the importHelpers compiler flag is the entire integration, after which TypeScript rewrites its emitted helper references to pull from tslib automatically. This zero-boilerplate design means the ergonomic surface is a single tsconfig option, while the fully typed, JSDoc-annotated declarations keep editors and type-checkers accurate for the rare cases where the helpers are referenced explicitly.

Used by 80 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

10,880

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
83
Repo Health
69
Technical
65
Dependency
Built with
TypeScript92%
Updated 2 weeks ago
Rust
67%
MIT

Bun

Developer Tools

95,452

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
66
Dependency
Built with
Rust67%
C++19%
Updated today
C++
51%
Other

Cocos Engine

Developer Tools · Game Development · Design Tools

9,761

Open-source, cross-platform 2D/3D game engine with Vulkan, Metal, and WebGL support for web, mobile, and instant gaming platforms

View details
68
Repo Health
79
Technical
71
Dependency
Built with
C++51%
TypeScript35%
Updated 1 months ago
TypeScript
45%
Other

Convex Backend

Developer Tools · Databases

12,394

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
TypeScript45%
Rust43%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search