Version 1.0.0
@stackline/tslib
Runtime library for TypeScript helper functions
Independent maintenance of tslib 2.8.1. Original authors and licenses are retained.
Installation
# Preserve existing imports with an npm alias
npm install tslib@npm:@stackline/tslib@1.0.0
# Or use the scoped package name in your imports
npm install @stackline/tslib@1.0.0Node.js: See compatibility notes. Read the compatibility and maintenance notes before migrating.
Usage and API
The reference below may retain upstream package names. Use the alias installation above to run those imports with this Stackline release.
For TypeScript importHelpers, use the tslib alias: generated helpers import that package name. Installing only the scoped name does not provide it.
tslib
This is a runtime library for TypeScript that contains all of the TypeScript helper functions.
This library is primarily used by the --importHelpers flag in TypeScript.
When using --importHelpers, a module that uses helper functions like __extends and __assign in the following emitted file:
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
exports.x = {};
exports.y = __assign({}, exports.x);
will instead be emitted as something like the following:
var tslib_1 = require("tslib");
exports.x = {};
exports.y = tslib_1.__assign({}, exports.x);
Because this can avoid duplicate declarations of things like __extends, __assign, etc., this means delivering users smaller files on average, as well as less runtime overhead.
For optimized bundles with TypeScript, you should absolutely consider using tslib and --importHelpers.
Installing
For the latest stable version, run:
npm
# TypeScript 3.9.2 or later
npm install tslib
# TypeScript 3.8.4 or earlier
npm install tslib@^1
# TypeScript 2.3.2 or earlier
npm install tslib@1.6.1
yarn
# TypeScript 3.9.2 or later
yarn add tslib
# TypeScript 3.8.4 or earlier
yarn add tslib@^1
# TypeScript 2.3.2 or earlier
yarn add tslib@1.6.1
bower
# TypeScript 3.9.2 or later
bower install tslib
# TypeScript 3.8.4 or earlier
bower install tslib@^1
# TypeScript 2.3.2 or earlier
bower install tslib@1.6.1
JSPM
# TypeScript 3.9.2 or later
jspm install tslib
# TypeScript 3.8.4 or earlier
jspm install tslib@^1
# TypeScript 2.3.2 or earlier
jspm install tslib@1.6.1
Usage
Set the importHelpers compiler option on the command line:
tsc --importHelpers file.ts
or in your tsconfig.json:
{
"compilerOptions": {
"importHelpers": true
}
}
For bower and JSPM users
You will need to add a paths mapping for tslib, e.g. For Bower users:
{
"compilerOptions": {
"module": "amd",
"importHelpers": true,
"baseUrl": "./",
"paths": {
"tslib" : ["bower_components/tslib/tslib.d.ts"]
}
}
}
For JSPM users:
{
"compilerOptions": {
"module": "system",
"importHelpers": true,
"baseUrl": "./",
"paths": {
"tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
}
}
}
Deployment
- Choose your new version number
- Set it in
package.jsonandbower.json - Create a tag:
git tag [version] - Push the tag:
git push --tags - Create a release in GitHub
- Run the publish to npm workflow
Done.
Contribute
There are many ways to contribute to TypeScript.
- Submit bugs and help us verify fixes as they are checked in.
- Review the source code changes.
- Engage with other TypeScript users and developers on StackOverflow.
- Join the #typescript discussion on Twitter.
- Contribute bug fixes.
Documentation
Upstream issues and maintenance review
Upstream origin and triage
- Original package:
tslib@2.8.1 - Repository: https://github.com/Microsoft/tslib
- Source commit: https://github.com/Microsoft/tslib/commit/d72d6f70b36286bc3f94a3dda1e64dcb568b1370
- Source directory:
. - npm tarball: https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz
- SHA512 integrity:
sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== - npm last-release age selects maintenance scope; it does not imply no ongoing source development.
Reviewed issues
Primary-source snapshot: 2026-09-29T00:21:42.770647+00:00. Most recently updated 100 open and 30 closed issue/PR entries; PRs removed. This is triage evidence, not a claim of exhaustive review.
Maintenance adoption with preserved runtime payload. No runtime defect correction is claimed. Reports remain visible for subsequent targeted reproduction.
- 286: __extends继承Array时,不符合预期
- 231: Regression failure upgrading from 2.5.0 to 2.5.1+, webpack fails to transpile new export statement for ES5.
- 161: Wrong exports in tslib
- 268: End of life support for tslib v2.3.0
- 264: import error: '__spreadArray' is not exported from 'tslib' (imported as '__spreadArray').
- 143: modules/index.js should re-export tslib.es6.js instead of tslib.js
- 232: Performance improvement
- 149: export '__spreadArray' (imported as '__spreadArray') was not found in 'tslib'
- 214: calls to tslib __setFunctionName fail on Cobalt 9
- 209: Cannot find module '...node_modules/tslib/modules/index.js' imported from chunks/app/server.mjs
- 212: tslib >=2.5.1 regression - increases bundle size caused by noop
Object.create;statements - 210: Generate SLSA Build L3 provenance
- 173: tslib should follow standards for ESM/CJS detection
- 190: __importDefault method may return an object with undefined default property
- 147: 'tslib' does not provide an export named '__decorate'
- 180: Is this project dead from community??
- 170: Package tslib has been ignored because it contains invalid configuration
- 175: TypeError when spreadArray is used on a string containing an emoji/Unicode character
- 74: __spread does not work in IE11
- 156: main.js:1 Uncaught Error: Cannot find module 'tslib'
- 150: question: why isn't it tslib distributed together with tsc?
- 148: Document compatibility of tslib with typescript
- 125: __spread Performance Issues
- 128: Version 1.14.0 removes default export
- 145: 2.1.0 version with node and jest mocking causes errors
- 132: Dead tslib.es6.js code
- 22: Document correspondence between TypeScript and tslib versions
- 115: v1.13.0 Error with older typescript version -- node_modules/tslib/tslib.d.ts(37,78): error TS2304: Cannot find name 'PropertyKey'. (When targeting es3)
- 104: "constructor" is enumerable when targetting es5
- 114: __importStar can result in undefined imports when importing cyclical dependencies
- 32: tslib is polluting window object
- 61: Document helpers needed per target platform
- 48: Lint tslib
- 46: tslib __decorate was conflict with property decorator definition
- 14: Override helpers
- 8: __awaiter helper with arrow functions from TypeScript compiler to tslib
The structured snapshot in .stackline/issue-triage.json also records recently closed reports. Issues for unrelated packages in shared monorepositories were qualified as outside this fork’s runtime scope. No maintainer was contacted.
Release files and references
Package bytes, npm provenance and the immutable GitHub release were verified for this version. Security checks describe the reviewed release; documented compatibility risks and upstream reports are not blanket claims of resolution.