npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

typescript-enhanced

v1.0.3

Published

Typescript Enhanced is an extension of the existing Typescript package that modifies the functionality of the tsc command giving it some superpowers

Downloads

19

Readme

Typescript Enhanced

Change Log

Typescript Enhanced is an extension of the existing Typescript package that modifies the functionality of the tsc command giving it some superpowers.

This package aims for the following guidelines:

  • Minimal external dependency
  • Minimal modifications on the original Typescript package
  • Minimal workflow changes
  • Maximal clarity of code

Other solutions that do the same task as Typescript Enhanced don't follow anything similar to this making hard knowing what happens under the hood. In this package you will be able to understand what is happening on the enhancements just by reading their source files.

The earliest version of Typescript supported by this package is actually v2.8.0 because Typescript Enhaced uses the internal mechanism of tsc watch mode. Maybe, if demanded, in a future release this could be upgraded.

Usage

npm i --save-dev typescript typescript-enhanced
npx tsce

This packages wraps the actual tsc command, so it needs typescript to work. Typescript Enhanced uses Typescript as peer dependency to make you able to use any supported version of the package.

Enhancements

Custom Transformers

With Typescript Enhanced you will be able to create any custom transformer you want to your source code using the internal mechanism of Typescript (since version v2.3.0).

To enable this enhacement just add to your tsconfig.json the following line.

{
  // ...
  "compilerOptions": {
      // ...
      "customTransformers": [
          {
              module: "<module path>",
              type: "<before/after>",
              options: {},
          }
      ]
      // ...
  }
  // ...
}

The custom transformer option applies the all the transformations on the order you specify them. You can find some custom transformer examples on the samples folder.

Resolve Aliased Modules

In Typescript Enhanced you will be able to finally resolve those messy imports that don't let you work on Node.js. To enable this enhacement just add to your tsconfig.json the following line.

{
  // ...
  "compilerOptions": {
      // ...
      "resolveAliasedModules": true
      // ...
  }
  // ...
}

This is applied as the last before transformation of the chain so you can modify its behaviour by using any before transformer if you want.

On Fail/Success Commands for watch mode

Sometimes do you want to do anything on watch mode states like starting a server or execute a post-process. This is actually imposible with the tsc command but tsce is able to manage this situation.

To enable this enhacement just add to your tsconfig.json the following line.

{
  // ...
  "compilerOptions": {
      // ...
      "onWatchFail": "<My command>",
      "onWatchSuccess": "<My command>"
      // ...
  }
  // ...
}

or just by adding the following parameters to the tsce command call

tsce --watch --onWatchFail <My command> --onWatchSuccess <My command>

Contribution

Any contribution to upgrade this package is actually welcome :)