tslib

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

Library
npm
v2.8.1
1,345 stars
0BSD

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
63 /100 Good
Development Activity 48
Maintenance 32
Community 84
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
81 /100 Excellent
Architecture 85
Code Quality 78
Innovation 82
Learning Curve 85

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 81 apps in this directory

C#
62%
MIT

Umbraco CMS

CMS

5,274

The friendly open-source .NET CMS that gives developers full control over content, structure, and delivery without lock-in.

View details
97
Repo Health
78
Technical
83
Dependency
Built with
C# 62%
TypeScript 38%
Updated 1 weeks ago
TypeScript
63%
AGPL 3.0

undb

Databases · No Code Platforms

2,975

Self-hosted no-code database and BaaS that lets you manage structured data visually with multi-database support, formula fields, and auto-generated OpenAPI endpoints.

View details
58
Repo Health
66
Technical
65
Dependency
Built with
TypeScript 63%
Svelte 35%
Updated 1 months ago
JavaScript
56%
MIT

Uptime Kuma

Monitoring

92,816

Self-hosted monitoring for every service you run — 23 monitor types, 95 notification channels, live dashboards, and public status pages with no vendor lock-in.

View details
92
Repo Health
81
Technical
62
Dependency
Built with
JavaScript 56%
Vue 41%
Updated 6 days ago
TypeScript
95%
Apache 2.0

Void

AI Code Assistants · Automation · Code Editors

28,733

Open-source AI code editor with direct LLM integration and data privacy

View details
44
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 95%
Updated 5 months ago
TypeScript
80%
AGPL 3.0

VoidAuth

Authentication · Security

2,889

Self-hosted SSO with OIDC, LDAP, passkeys, and proxy auth for your entire self-hosted stack

View details
83
Repo Health
77
Technical
72
Dependency
Built with
TypeScript 80%
HTML 14%
Updated 1 weeks ago
Rust
33%
Other

Windmill

Automation · Developer Tools

18,257

Turn scripts into webhooks, workflows, and auto-generated UIs — the fastest self-hostable workflow engine, 13x faster than Airflow.

View details
91
Repo Health
82
Technical
64
Dependency
Built with
Rust 33%
TypeScript 24%
Svelte 22%
Updated 6 days ago
TypeScript
96%
GPL 3.0

Wire

Collaboration · Team Chat · Video Conferencing

1,192

Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.

View details
93
Repo Health
8
Technical
68
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
TypeScript
95%
MIT

Zenbu.js

AI Development · Developer Tools

269

An open-source TypeScript framework for Electron apps that ship raw, uncompiled source, hot-reload instantly, and let users hack and extend running code via plugins.

View details
43
Repo Health
73
Technical
72
Dependency
Built with
TypeScript 95%
Updated 4 months ago
Go
74%
AGPL 3.0

ZITADEL

Authentication

15,418

Open-source, API-first identity platform delivering multi-tenancy, Passkeys, OIDC, SAML, and SCIM without vendor lock-in.

View details
92
Repo Health
81
Technical
65
Dependency
Built with
Go 74%
TypeScript 12%
Updated 1 weeks ago

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