https://github.com/namchee/henshin
Collection of TypeScript transformers for various uses,
https://github.com/namchee/henshin
transformers typescript
Last synced: over 1 year ago
JSON representation
Collection of TypeScript transformers for various uses,
- Host: GitHub
- URL: https://github.com/namchee/henshin
- Owner: Namchee
- License: mit
- Created: 2024-01-20T04:59:23.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-27T10:55:53.000Z (over 2 years ago)
- Last Synced: 2025-03-02T12:16:14.922Z (over 1 year ago)
- Topics: transformers, typescript
- Language: TypeScript
- Homepage:
- Size: 79.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Henshin
Collection of TypeScript custom transformers for various uses.
## Transformers
Below are the list of available transformers in [packages](./packages). All transformers can be installed through `@namchee/henshin-`.
| Name | Description |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [`strip-debug`](packages/strip-debug) | Replaces debugging statements with [void expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void) |
## Usage
There are 4 ways to consume the transformers:
1. **CLI Wrapper**
By default, TypeScript [does not support custom transformers](https://github.com/microsoft/TypeScript/issues/14419) by default. The community addresses this issue by providing a CLI wrapper that augments the functionality of `tsc`. such as [`ttypescript`](https://github.com/cevek/ttypescript) and [`ts-patch`](https://github.com/nonara/ts-patch).
2. **Compiler API**
Besides using third-party, custom compilers can be consumed by creating your own pipeline using [Compiler API](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API) using `transform` or `transpile`.
2. **Bundlers**
Some bundlers provides way to consume custom transformers through plugins such as [`webpack` via `ts-loader`](https://github.com/TypeStrong/ts-loader#getcustomtransformers) or [`ttypescript` plugin for `parcel` and `rollup`](https://github.com/cevek/ttypescript#parcel)
3. **Helper function**
For convenience, every transformers in Henshin exposes a helper function besides transformer factory that takes care of the transformation process by simply providing the file contents and options. Please refer to each package `README.md` for more information about helper functions.
## License
This project is licensed under the [MIT License](./LICENSE)