Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-helpers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-helpers

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

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
decreased by-5.54%
Maintainers
1
Weekly downloads
 
Created
Source

TS-helpers

Dependencies Status devDependency Status npm GitHub license

Typescript helpers for compiling typescript while specifying --noEmitHelpers within your tsconfig.json.

Cross platform ( Node/Browser/WebWorker )

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: truewhich 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:

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

and set tsconfig noEmitHelpers like following example:

{
  "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 ;)

Keywords

FAQs

Package last updated on 17 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc