npm.io
1.2.1 • Published 2 years agoCLI

a-transform-transformer

Licence
MIT
Version
1.2.1
Deps
4
Size
9 kB
Vulns
0
Weekly
0
Stars
1

A-transformer-transformer

All Contributors

The a-transformer-transformer is a tool that allows you to migrate your Angular @Input()which are of type boolean or number to use the new transform property with the booleanAttribute or the numberAttribute transformer.

If you have @Input with existing decorator arguments for example (@Input({required: true})) the tool will merge them with the transform: booleanAttribute.

Installation

The package can either be installed locally inside your project as a dev dependency or globally. Since its a one time migration tool we think its best used with npx though.

Local

 npm i -D a-transformer-transformer
Global
 npm i -g a-transformer-transformer
npx
 npx a-transformer-transformer

Usage

To use the transformer just execute one of the following commands inside the root of your project.

Transform boolean

The transformer currently offers the option to add {transform: booleanAttribute} to your @Input() of type boolean. To do so you have to run the following command.

npx a-transformer-transformer -b
Transform numbers

The transformer currently offers the option to add {transform: numberAttribute} to your @Input() of type number. To do so you have to run the following command.

npx a-transformer-transformer -n
Transform all

To apply all available transformations you can run the following command.

npx a-transformer-transformer -a
Help

To get a list of all the available options you can always run the following command.

npx a-transformer-transformer -h

Contributors

Thanks goes to these wonderful people (emoji key):

Nivek
Nivek

Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords