chai
npmv6.2.2BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
Safe to adopt
Yes — chai scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 261 days ago. 14 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- BMaintenance: grade B, Good.
Last published 261 days ago. 14 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 143 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — 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 chai 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 >=18
- Module format
- ESM only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the chai README.
<script src="./node_modules/chai/index.js" type="module"></script>chai 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 |
|---|---|---|---|---|
| chaithis page | 0 | 57 | MIT | 8 months ago |
| expect-type | 78.4M | 8 | Apache-2.0 | 1 day ago |
| @vitest/expect | 0 | 1 | MIT | 1 day ago |
| assertion-error | 89.6M | 2 | MIT | 1 day ago |
| jest | 42.1M | 70 | MIT | 1 day ago |
| @jest/core | 0 | 2 | MIT | 1 day ago |
Dependencies
Declared by chai v6.2.2. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (18)
Used by
Popular packages that depend on chai.
easily create complex multi-column command-line-interfaces
the mighty option parser used by yargs
A light-weight module that brings Fetch API to node.js
ECMAScript JS AST traversal functions
An AST-based pattern checker for JavaScript.
the bare-bones internationalization library used by yargs
A JavaScript text diff implementation.
Next generation testing framework powered by Vite
Reactive Extensions for modern JavaScript
Additional JSON-Schema keywords for Ajv JSON validator
Source maps support for istanbul
The postgres client/server binary protocol, implemented in TypeScript
Functions for dealing with a PostgreSQL connection string
Universal WHATWG Fetch API for Node, Browsers and React Native
Type safe SQL query builder
MongoDB connection strings, based on the WhatWG URL API
Official client encryption module for the MongoDB Node.js driver
A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3
Universal module importer for Node.js
Data library for istanbul coverage objects
The fastest and simplest library for SQLite in Node.js.
utility box for ECMAScript language tools
A CSS selector engine.
An evented streaming XML parser in JavaScript
Relationship graph
Dependencies (left) and dependents (right) of chai.
Frequently installed together
TypeScript definitions for node
An AST-based pattern checker for JavaScript.
Prettier is an opinionated code formatter
TypeScript definitions for chai
The semantic version parser used by npm.
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
Fixes stack traces for files with source maps
TypeScript execution environment and REPL for node.js, with source map support
the most correct and second fastest glob implementation in JavaScript
Runtime typescript and ESM support for Node.js
A JavaScript implementation of many web standards
the complete solution for node.js command-line programs
Release history
13 releases in the last two years, typically about 18 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 6.2.2latest | 8 months ago | 143 KB | MIT |
| 6.2.1 | 10 months ago | 150 KB | MIT |
| 6.2.0 | 11 months ago | 149 KB | MIT |
| 6.1.0 | 11 months ago | 149 KB | MIT |
| 5.3.3 | 1 year ago | 428 KB | MIT |
| 6.0.1 | 1 year ago | 149 KB | MIT |
| 6.0.0 | 1 year ago | 142 KB | MIT |
| 5.3.2 | 1 year ago | 421 KB | MIT |
| 5.3.1 | 1 year ago | 288 KB | MIT |
| 5.3.0 | 1 year ago | 428 KB | MIT |
| 5.2.2 | 1 year ago | 428 KB | MIT |
| 5.2.1 | 1 year ago | 508 KB | MIT |
| 5.2.0 | 1 year ago | 503 KB | MIT |
| 5.1.2 | 1 year ago | 496 KB | MIT |
| 4.5.0 | 2 years ago | 727 KB | MIT |
Overview
chai is an npm package that bDD/TDD assertion library for node.js and the browser. Test framework agnostic. It has 57 known dependents in the graph. The latest version is 6.2.2, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need bDD/TDD assertion library for node.js and the browser. Test framework agnostic and value a focused solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
- Trusted by 57 other packages.
Cons
- Large dependency tree (18 direct dependencies) increases install size and audit surface.
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use chai?
Yes — chai scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 261 days ago. 14 releases in the last 2 years.
How do I install chai?
Run `npm install chai` to add chai to your npm project.
What license is chai released under?
chai is distributed under the MIT license.
How popular is chai?
npm does not publish download counts. Within PackageGraph's crawl, 57 known packages depend on chai.
Is chai still maintained?
The most recent release of chai (v6.2.2) was published 8 months ago.
Does chai run install scripts?
No. chai does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.