invariant
npmv2.2.4invariant
Overview
invariant is an npm package that invariant. It is extremely widely used, with about 28.3M downloads per week and 8 known dependents in the graph. The latest version is 2.2.4, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need invariant and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (28.3M weekly downloads).
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of invariant.
Dependencies
Runtime (1)
Dev (3)
Used by
Popular packages that depend on invariant.
Dev server middleware for React Native
A framework for building native apps using React
Core CLI commands for React Native
The core of Expo Modules architecture
React Native WebView component for iOS, Android, macOS, and Windows
A metro-file-map fork for Expo used with the Metro bundler
🚇 A tool to find the source location from JS bundles and stack traces.
Babel plugin for React Compiler.
🚇 The JavaScript bundler for React Native.
🚇 Source map generator for Metro.
Virtualized lists for React Native.
Code generation tools for React Native
Expo Router is a file-based router for React Native and web applications.
[Experimental] - 🚇 File crawling, watching and mapping for Metro
Alternatives to invariant
Get the first fulfilled promise that satisfies the provided testing function
Get details about the current Continuous Integration environment
Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet
Delightful JavaScript Testing.
Jest's expect matchers as a Chai plugin
[](https://github.com/mmkal/expect-type/actions/workflows/ci.yml)  [](ht
Vitest module mocker implementation
Vitest snapshot manager
Vitest test runner
Node is running but you don't know why? why-is-node-running is here to help you.
Fork of pretty-format with support for ESM
Delightful JavaScript Testing.
Frequently installed together
flow typed nullthrows
React is a JavaScript library for building user interfaces.
Lightweight debugging utility for Node.js and the browser
TypeScript definitions for react
A framework for building native apps using React
Runtime to be use with the Flow Enums transform.
A JavaScript parser
Generates and consumes source maps
TypeScript definitions for node
No description provided.
yargs the modern, pirate-themed, successor to optimist.
Babel Types is a Lodash-esque utility library for AST nodes
Version history
| Version | Published | License |
|---|---|---|
| 2.2.4latest | 8 years ago | MIT |
| 2.2.3 | 8 years ago | MIT |
| 2.2.2 | 9 years ago | BSD-3-Clause |
| 2.2.1 | 10 years ago | BSD-3-Clause |
| 2.2.0 | 10 years ago | BSD-3-Clause |
| 2.1.3 | 10 years ago | BSD-3-Clause |
| 2.1.2 | 10 years ago | BSD-3-Clause |
| 2.1.1 | 10 years ago | BSD-4-Clause |
| 2.1.0 | 11 years ago | BSD |
| 2.0.0 | 11 years ago | MIT |
| 1.0.2 | 11 years ago | MIT |
| 1.0.1 | 11 years ago | MIT |
| 1.0.0 | 11 years ago | MIT |
Frequently asked questions
How do I install invariant?
Run `npm install invariant` to add invariant to your npm project.
What license is invariant released under?
invariant is distributed under the MIT license.
How popular is invariant?
invariant has approximately 28,340,950 downloads per week and 8 known dependent packages.