All Projects → microsoft → Tslib

microsoft / Tslib

Licence: 0bsd
Runtime library for TypeScript helpers.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Tslib

Sensiodistributionbundle
Base bundle for Symfony Distributions
Stars: ✭ 501 (-34.25%)
Mutual labels:  bundle
React Native Restart
React Native Package With One Purpose: To Restart Your React Native Project
Stars: ✭ 604 (-20.73%)
Mutual labels:  bundle
Craueformflowbundle
Multi-step forms for your Symfony project.
Stars: ✭ 654 (-14.17%)
Mutual labels:  bundle
Sentry Symfony
The official Symfony SDK for Sentry (sentry.io)
Stars: ✭ 515 (-32.41%)
Mutual labels:  bundle
Blender Osm
One click download and import of OpenStreetMap and terrain for Blender! Global coverage! Source code is in the branch 'release'.
Stars: ✭ 588 (-22.83%)
Mutual labels:  import
Tf trt models
TensorFlow models accelerated with NVIDIA TensorRT
Stars: ✭ 621 (-18.5%)
Mutual labels:  optimize
Style Resources Module
Nobody likes extra @import statements!
Stars: ✭ 485 (-36.35%)
Mutual labels:  import
Microbundle
📦 Zero-configuration bundler for tiny modules.
Stars: ✭ 6,622 (+769.03%)
Mutual labels:  bundle
Poi
⚡A zero-config bundler for JavaScript applications.
Stars: ✭ 5,291 (+594.36%)
Mutual labels:  bundle
Knpgaufrettebundle
Easily use Gaufrette in your Symfony projects.
Stars: ✭ 646 (-15.22%)
Mutual labels:  bundle
Lazy importer
library for importing functions from dlls in a hidden, reverse engineer unfriendly way
Stars: ✭ 544 (-28.61%)
Mutual labels:  import
Cpm.cmake
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.
Stars: ✭ 560 (-26.51%)
Mutual labels:  dependency
Elasticsearch Dump
Import and export tools for elasticsearch
Stars: ✭ 5,977 (+684.38%)
Mutual labels:  import
Simple Excel
Read and write simple Excel and CSV files
Stars: ✭ 502 (-34.12%)
Mutual labels:  import
Projeny
A project and package manager for Unity
Stars: ✭ 656 (-13.91%)
Mutual labels:  dependency
Optimizer
Make Windows faster and more secure
Stars: ✭ 489 (-35.83%)
Mutual labels:  optimize
Liipfunctionaltestbundle
Some helper classes for writing functional tests in Symfony
Stars: ✭ 604 (-20.73%)
Mutual labels:  bundle
Img Optimizer Gradle Plugin
一款用于优化png图片的gradle插件,有效减少APK体积,支持极限压缩和无损压缩。
Stars: ✭ 718 (-5.77%)
Mutual labels:  optimize
Symfony
The Symfony PHP framework
Stars: ✭ 26,220 (+3340.94%)
Mutual labels:  bundle
Sensiogeneratorbundle
Generates Symfony bundles, entities, forms, CRUD, and more...
Stars: ✭ 634 (-16.8%)
Mutual labels:  bundle

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 [email protected]^1

# TypeScript 2.3.2 or earlier
npm install [email protected]

yarn

# TypeScript 3.9.2 or later
yarn add tslib

# TypeScript 3.8.4 or earlier
yarn add [email protected]^1

# TypeScript 2.3.2 or earlier
yarn add [email protected]

bower

# TypeScript 3.9.2 or later
bower install tslib

# TypeScript 3.8.4 or earlier
bower install [email protected]^1

# TypeScript 2.3.2 or earlier
bower install [email protected]

JSPM

# TypeScript 3.9.2 or later
jspm install tslib

# TypeScript 3.8.4 or earlier
jspm install [email protected]^1

# TypeScript 2.3.2 or earlier
jspm install [email protected]

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/[email protected]/tslib.d.ts"]
        }
    }
}

Contribute

There are many ways to contribute to TypeScript.

Documentation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].