New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

typewiz-node

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typewiz-node

Automatically add types to node.js TypeScript code using [typewiz-core](https://www.npmjs.com/package/typewiz-core)

latest
Source
npmnpm
Version
1.2.4
Version published
Weekly downloads
236
11.32%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 23 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts