typewiz-node
Automatically add types to node.js TypeScript code using typewiz-core
Installation
yarn global add typewiz-node
or
npm install -g typewiz-node
Usage
typewiz-node <main.ts>
If you want to enable typewiz for your mocha test, simply add -r typewiz-node/dist/register
to your mocha command-line, e.g.:
mocha -r typewiz-node/dist/register src/**/test.ts
This will run your unit tests, discover type information, and write it back to your source files.
Example
Given the following input file:
console.loggreet'Uri';
Typewiz will run the program and then the code will be updated as following:
console.loggreet'Uri';
Note the addition of the : string
type for the who
parameter in the first line.
License
MIT