expect-type
npmv1.4.0TypeScript[](https://github.com/mmkal/expect-type/actions/workflows/ci.yml)  [](ht
Safe to adopt
Yes — expect-type scores well across adoption, maintenance, weight, supply chain, and licensing. 78.4M downloads per week and 8 known dependents. Last published 76 days ago. 8 releases in the last 2 years.
- AAdoption: grade A, Excellent.
78.4M downloads per week and 8 known dependents.
- AMaintenance: grade A, Excellent.
Last published 76 days ago. 8 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 135 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
Apache-2.0 — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding expect-type to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node >=12.0.0
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the expect-type README.
import {expectTypeOf} from 'expect-type'
import {foo, bar} from '../foo'
// make sure `foo` has type {a: number}
expectTypeOf(foo).toEqualTypeOf<{a: number}>()
// make sure `bar` is a function taking a string:
expectTypeOf(bar).parameter(0).toBeString()
expectTypeOf(bar).returns.not.toBeAny()expect-type vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| expect-typethis page | 78.4M | 8 | Apache-2.0 | 2 months ago |
| csstype | 142.8M | 2 | MIT | 1 day ago |
| jest | 42.1M | 70 | MIT | 1 day ago |
| chai | 0 | 57 | MIT | 1 day ago |
| jest-cli | 0 | 3 | MIT | 1 day ago |
| @jest/core | 0 | 2 | MIT | 1 day ago |
Dependencies
Declared by expect-type v1.4.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (12)
Used by
Popular packages that depend on expect-type.
A collection of essential TypeScript types
Next generation testing framework powered by Vite
A memoization library which only remembers the latest invocation
Node.js utilities and TypeScript definitions for `package.json` and `tsconfig.json`
Convert character encodings in pure javascript.
Unified Package Manager for Node.js
A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3
Serialize/deserialize an error into a plain object
Relationship graph
Dependencies (left) and dependents (right) of expect-type.
Frequently installed together
TypeScript definitions for node
V8 coverage provider for Vitest
Universal filesystem path utils
Native-ESM powered web dev build tool
A JavaScript implementation of many web standards
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
Public API for OpenTelemetry
Low level bindings for creating Web Standard contexts.
An AST-based pattern checker for JavaScript.
Prettier is an opinionated code formatter
Runtime agnostic JS utils
Next generation testing framework powered by Vite
Release history
5 releases in the last two years, typically about 24 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.4.0latest | 2 months ago | 135 KB | Apache-2.0 |
| 1.3.0 | 9 months ago | 117 KB | Apache-2.0 |
| 1.2.2 | 1 year ago | 116 KB | Apache-2.0 |
| 1.2.1 | 1 year ago | 113 KB | Apache-2.0 |
| 1.2.0 | 1 year ago | 113 KB | Apache-2.0 |
| 1.1.0 | 1 year ago | 108 KB | Apache-2.0 |
| 1.0.0 | 1 year ago | 106 KB | Apache-2.0 |
| 1.0.0-rc.0 | 2 years ago | 106 KB | Apache-2.0 |
| 0.20.0 | 2 years ago | 106 KB | Apache-2.0 |
| 0.20.0-0 | 2 years ago | 103 KB | Apache-2.0 |
| 0.19.0 | 2 years ago | 81 KB | Apache-2.0 |
| 0.18.0 | 2 years ago | 55 KB | Apache-2.0 |
| 0.17.3 | 2 years ago | 55 KB | Apache-2.0 |
| 0.17.3-0 | 2 years ago | 54 KB | Apache-2.0 |
| 0.17.2 | 2 years ago | 54 KB | Apache-2.0 |
Overview
expect-type is an npm package that [](https://github.com/mmkal/expect-type/actions/workflows/ci.yml)  [](ht. It is extremely widely used, with about 78.4M downloads per week and 8 known dependents in the graph. The latest version is 1.4.0, released under the Apache-2.0 license.
Who should use it
Teams working in the npm ecosystem who need [](https://github.com/mmkal/expect-type/actions/workflows/ci.yml)  [](ht and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (78.4M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (Apache-2.0).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use expect-type?
Yes — expect-type scores well across adoption, maintenance, weight, supply chain, and licensing. 78.4M downloads per week and 8 known dependents. Last published 76 days ago. 8 releases in the last 2 years.
How do I install expect-type?
Run `npm install expect-type` to add expect-type to your npm project.
What license is expect-type released under?
expect-type is distributed under the Apache-2.0 license.
How popular is expect-type?
expect-type has approximately 78,351,861 downloads per week and 8 known dependent packages.
Is expect-type still maintained?
The most recent release of expect-type (v1.4.0) was published 2 months ago.
Does expect-type run install scripts?
No. expect-type does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.