Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath authored Jul 14, 2018
1 parent 6b24b5c commit 3854a1c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Code-Modifier for Typescript based projects
- [Command Line Usage](#command-line-usage)
- [CLI Arguments](#cli-arguments)
- [Custom Transformation](#custom-transformation)
- [Running a custom transformation](#running-a-custom-transformation)

## Installation

Expand All @@ -18,10 +17,10 @@ npm i -g ts-codemod

## Command Line Usage

A typical command looks like
A typical command looks like -

```bash
ts-codemod --write --transformation [transformation name] --params.[param name] [param value] [glob pattern]
ts-codemod --write --transformation=[transformation name] --params.[param name]=[param value] [glob pattern]
```

Say I want to —
Expand Down Expand Up @@ -50,7 +49,7 @@ ts-codemod --write --transformation normalize-import-path --params.moduleName=c

## Custom transformation

A custom transformation can be implemented via extending the `Transformation` class.
A custom transformation (`my-custom-transformation.ts`) can be implemented via extending the `Transformation` class.

```ts
import * as ts from 'typescript'
Expand All @@ -64,7 +63,7 @@ export default class MyCustomTransformation extends Transformation {
}
```

## Running a custom transformation
It can then be executed as —

```bash
ts-codemod -t ./my-custom-transformation.ts src/**.ts
Expand Down

0 comments on commit 3854a1c

Please sign in to comment.