javascript-to-typescript
1.0.2 • Public • Published

javascript-to-typscript
Utility to help migrate javascript apps to typescript.
Install
$ npm install javascript-to-typescript
Usage
$ js-to-ts [OPTION] [PATH]
-p --startPath : starting path
-f --filter : filter pattern
-d --dryRun : dry run
- All commands should be run from the root of your project
- Running any of these commands will also install the following NPM packages
Default options
Before | After |
src/
├── file1.js
├── file2.js
└── module/
└── views/
└── view1.html
├── file1.js
└── file2.js
|
src/
├── file1.ts
├── file2.ts
└── module
└── views/
└── view1.html
├── file1.ts
└── file2.ts
├── tsconfig.json
└── typings.json
|
Specific Directory
$ js-to-ts --startPath ./src
Before | After |
.
src/
├── file1.js
├── file2.js
└── module/
└── views/
└── view1.html
├── file1.js
└── file2.js
└── utilities/
├── file1.js
└── file2.js
|
.
src/
├── files1.ts
├── file2.ts
└── module
└── views/
└── view1.html
├── file1.ts
└── file2.ts
└── utilities/
├── file1.js
└── file2.js
├── tsconfig.json
└── typings.json
|
Additional Filter
$ js-to-ts --filter '**/file1.js'
Before | After |
src/
├── file1.js
├── file2.js
└── module/
└── views/
└── view1.html
├── file1.js
└── file2.js
|
src/
├── file1.ts
├── file2.js
└── module
└── views/
└── view1.html
├── file1.ts
└── file2.js
├── tsconfig.json
└── typings.json
|
Dry Run
$ js-to-ts -p ./src --dryRun
$ Files to Migrate: [
'src/file1.js',
'src/file2.js',
'module/file1.js',
'module/file2.js'
]
Package Sidebar
Install
npm i javascript-to-typescript
Weekly Downloads