qmetrics.net

nyc

Command-line Istanbul code coverage for JavaScript

nyc screenshot

nyc is Istanbul’s CLI for JavaScript coverage. It instruments code during tests and reports how thoroughly suites exercise your project.

Overview

nyc is the command-line front end to Istanbul’s JavaScript coverage tooling. It inserts line counters into ES5 and ES2015+ source so unit tests reveal which lines, branches, and functions ran. It cooperates with runners such as tap, mocha, and AVA, and handles apps that spawn subprocesses plus source-mapped Babel and TypeScript projects.

Install it as a dev dependency or invoke via npx, then prefix existing test commands with nyc. Configuration lives in package.json, .nycrc files, or nyc.config.js, covering reporters, include and exclude globs, coverage thresholds, caching, and merging results from multiple runs.

Presets exist for Babel and TypeScript setups. Users on jest or tap may rely on those tools’ built-in Istanbul integration instead. Advanced options control all-file instrumentation, subprocess handling, watermarks, and Istanbul ignore hints in source.

The tool is widely used to gate CI on coverage minimums and to produce HTML or lcov reports for review.

Key features

  • CLI wrapper over Istanbul instrumentation
  • Subprocess coverage collection
  • Babel and TypeScript source-map support
  • Multiple reporters including lcov and text
  • Include and exclude glob selection
  • Configurable coverage thresholds
  • Merge reports across test runs
  • Shared config via extends and npm modules

Use cases

  • Measure unit test coverage in Node projects
  • Enforce coverage thresholds in CI
  • Generate HTML coverage reports
  • Combine coverage from parallel test jobs

Tags

Similar software

ShellCheck

Static analysis and linting for Bash shell scripts

ShellCheck scans bash and POSIX shell scripts for syntax, semantic, and portability problems. It is available as a CLI tool, editor integration, web paste interface, and CI hook.

★ 40.4k⟳ todayGPL-3.0

Mypy

Optional static type checker for Python

Mypy checks Python programs against PEP 484 type hints before you run them. It supports gradual typing so you can add annotations over time.

★ 20.7k⟳ todayMIT · open core

typescript-eslint

ESLint tooling for linting TypeScript codebases

typescript-eslint connects ESLint to TypeScript syntax and ships parser services plus lint rules. It enables standard and type-aware linting for JavaScript and TypeScript projects.

★ 16.5k⟳ 2 days agoMIT

React Doctor

CLI static analysis for React code quality

React Doctor scans React projects for correctness, performance, security, accessibility, and maintainability issues. Run it locally, in CI, or as an agent skill.

★ 15.2k⟳ 11 days agoMIT

Ajv

JSON Schema and JSON Type Definition validator for JavaScript

Ajv compiles JSON Schemas into validation functions for Node.js and browsers. It supports multiple JSON Schema drafts and JSON Type Definition (RFC 8927).

★ 14.9k⟳ 7 months agoMIT

Why Did You Render

React and React Native avoidable re-render diagnostics

Welldone Software’s library monkey-patches React in development to log when components render and why. It highlights redundant updates and works with React Native.

★ 12.5k⟳ 1 year agoMIT