# ts-helpers

> Typescript helpers for compiling typescript while specifying `--noEmitHelpers` within your `tsconfig.json`. Cross platform ( Node/Browser/WebWorker )

Latest version **1.1.2** (published 2016-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-helpers
pnpm add ts-helpers
yarn add ts-helpers
bun add ts-helpers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2016-10-14 |
| First published | 2016-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Martin Hochel |
| Maintainers | ngparty |
| Keywords | typescript, emit-helpers, payload |

## Links

- npm: https://www.npmjs.com/package/ts-helpers
- Repository: https://github.com/ngParty/ts-helpers
- Homepage: https://github.com/ngParty/ts-helpers#readme
- Issues: https://github.com/ngParty/ts-helpers/issues
- npm.io page: https://npm.io/package/ts-helpers

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2016-10-14
- 1.1.1 — 2016-04-25
- 1.1.0 — 2016-04-17
- 1.0.0 — 2016-04-17

## README

# TS-helpers

[![Dependencies Status](https://david-dm.org/ngParty/ts-helpers.svg)](https://david-dm.org/ngParty/ts-helpers)
[![devDependency Status](https://david-dm.org/ngParty/ts-helpers/dev-status.svg)](https://david-dm.org/ngParty/ts-helpers#info=devDependencies)
[![npm](https://img.shields.io/npm/v/ts-helpers.svg)](https://www.npmjs.com/package/ts-helpers)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ngParty/ts-helpers/master/LICENSE)
 
Typescript helpers (TS <= 2.0) for compiling typescript while specifying `--noEmitHelpers` within your `tsconfig.json`.
> Cross platform ( Node/Browser/WebWorker )

## NOTE: Starting Typescript 2.1 this package won't be needed anymore

Instead you can provide `--importHelpers` together with `--noEmitHelpers` which will import emit helpers from Typescript "tslib"
More info: https://github.com/Microsoft/TypeScript/pull/9097

## Why?

If you are using one of following ES2015/ES.next features with Typescript:
- inheritance via `class Foo extends Moo{}`
- `async/await`
- decorators via `experimentalDecorators` 
- metadata reflection via `emitDecoratorMetadata`
 
Typescript will generate helper code in every one file.
This can be a problem when dealing with code coverage or payload size of you library/app

To mitigate this problem Typescript starting from version **1.8** allow us to specify `noEmitHelpers: true`which wont generate these helpers.

And that's where this little utility comes into play, it defines those helpers just once for whole app.

## Installation

`npm install --save-dev ts-helpers`

then load it from your app root file:

```typescript
// main.ts
import 'ts-helpers';
```

and set tsconfig `noEmitHelpers` like following example:
```json
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "noImplicitAny": false,
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "pretty": true,
    "noEmitHelpers": true
  },
  "exclude": [
    "node_modules"     
  ]
}
```


That's it! enjoy ;)

---
_Source: https://npm.io/package/ts-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
