# tscov

> Check the type coverage of any TypeScript project with this easy npm package

Latest version **1.3.3** (published 2019-02-06) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install tscov
pnpm add tscov
yarn add tscov
bun add tscov
```

Provides the command `tscov`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.3.3 |
| Published | 2019-02-06 |
| First published | 2019-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 87.8 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Jeroen Ouwehand |
| Maintainers | jeroenouw |
| Keywords | cli, tscov, typescript, javascript, type, coverage, nodejs |

## Links

- npm: https://www.npmjs.com/package/tscov
- Repository: https://github.com/jeroenouw/tscov
- Homepage: https://github.com/jeroenouw/tscov#readme
- Issues: https://github.com/jeroenouw/tscov/issues
- npm.io page: https://npm.io/package/tscov

## Dependencies (8)

- [glob](https://npm.io/package/glob.md) 7.1.3
- [tslib](https://npm.io/package/tslib.md) 1.9.3
- [figlet](https://npm.io/package/figlet.md) ^1.2.1
- [prompts](https://npm.io/package/prompts.md) ^2.0.1
- [minimist](https://npm.io/package/minimist.md) 1.2.0
- [commander](https://npm.io/package/commander.md) ^2.19.0
- [inversify](https://npm.io/package/inversify.md) ^5.0.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.3.3 (latest) — 2019-02-06
- 1.3.2 — 2019-02-06
- 1.3.1 — 2019-02-05
- 1.3.0 — 2019-02-02
- 1.2.1 — 2019-01-30
- 1.2.0 — 2019-01-30
- 1.1.0 — 2019-01-21
- 1.0.1 — 2019-01-19
- 1.0.0 — 2019-01-19

## README

# TSCOV - Check the type coverage of any TypeScript project with this easy npm package

[![tscov](https://img.shields.io/badge/dynamic/json.svg?label=tscov&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.minCoverage&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fjeroenouw%2Ftscov%2Fmaster%2Fpackage.json)](https://github.com/jeroenouw/tscov)
[![npmversion](https://img.shields.io/npm/v/tscov.svg)](https://github.com/jeroenouw/tscov)
[![npmlicense](https://img.shields.io/npm/l/tscov.svg)](https://github.com/jeroenouw/AngularMaterialFirebase/blob/master/LICENSE/)
[![downloads](https://img.shields.io/npm/dy/tscov.svg)](https://github.com/jeroenouw/tscov)

## Quick start

### Globally

First globally install `tscov` by running the following in the command line. 

```shell
npm i tscov -g

cd <your-repo-location>

# To run the coverage of the types.
tscov
```

### Project

Go to your local project in the command line.  
Then install `tscov` as devDependency by running:

```shell
npm i tscov --save-dev
```

And set tscov up by adding an extra npm script in your `package.json` like this:

```json
"scripts": {
    "tscov": "tscov -m NUMBER"
},
```

Then you could run this with:

```shell
npm run tscov
```

## How to use

You can use the following commands in the command line or in a project as npm script:

```shell
# Show max reachable coverage and covered/uncovered types (default 90% minimal coverage)
tscov

# Define your minimum wanted coverage % by replacing `NUMBER` (0-100) with `95` for example 
tscov -m NUMBER
tscov --min-coverage NUMBER

# Show all uncovered types  
tscov -d
tscov --details

# Test specific folder
tscov -p PATH_TO_FOLDER/FOLDERNAME
tscov --project PATH_TO_FOLDER/FOLDERNAME

# Testing specific files
tscov -p PATH_TO_FOLDER/FOLDERNAME -f FILENAME.ts
tscov --project PATH_TO_FOLDER/FOLDERNAME --file FILENAME.ts

# Start debugging
tscov --debug

# Show version
tscov -v
tscov --version

# Show all available options
tscov -h
tscov --help
```

## Example output

Example by running this command: `tscov --min-coverage=95`.

```shell
  _____   ____     ____    ___   __     __
 |_   _| / ___|   / ___|  / _ \  \ \   / /
   | |   \___ \  | |     | | | |  \ \ / /
   | |    ___) | | |___  | |_| |   \ V /
   |_|   |____/   \____|  \___/     \_/

The TypeScript CLI to calculate type coverage


----------------- coverage ------------------
3337 - max reachable type coverage
3287 - types covered
50 - types uncovered

98.50% - coverage percentage
You can run "tscov --details" to show all uncovered types.
```

## Contributing

Want to file a bug, contribute some code, or improve documentation? Feel free to place an [issue](https://github.com/jeroenouw/tscov/issues).  

First fork this project.  

```shell
git clone <your-forked-repo>
npm install

git checkout -b my-fix
# fix some code...

git commit -m "added this feature"
git push origin my-fix
```

Lastly, open a pull request on Github.

The following npm script are available

- `npm start` - create build, install globally and run tscov
- `npm run build` - create build
- `npm run global` - install globally and run tscov
- `npm run link-upstream` - add remote
- `npm run sync` - fetch, checkout, merge and push
- `npm run reset` - removes node modules, package-lock.json, lib and re-installs everything.

## License

[![npmlicense](https://img.shields.io/npm/l/tscov.svg)](https://github.com/jeroenouw/tscov/blob/master/LICENSE/)

## Credits

[Plantain-00](https://github.com/plantain-00/type-coverage)

---
_Source: https://npm.io/package/tscov · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
