tn
typewiz-node
npm i typewiz-node
tn

typewiz-node

Automatically discover and add missing types in your TypeScript code

by Uri Shaked

1.2.4 (see all)License:MITTypeScript:Built-In
npm i typewiz-node
Readme

typewiz-node

Automatically add types to node.js TypeScript code using typewiz-core

Build Status Coverage Status

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:

function greet(who) {
    return `Hello, ${who}`;
}

console.log(greet('Uri'));

Typewiz will run the program and then the code will be updated as following:

function greet(who: string) {
    return `Hello, ${who}`;
}

console.log(greet('Uri'));

Note the addition of the : string type for the who parameter in the first line.

License

MIT

Downloads/wk

9

GitHub Stars

1.1K

LAST COMMIT

NaNyrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

27

OPEN PRs

8
VersionTagPublished
1.2.4
latest
4yrs ago
1.1.0-1
next
4yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate