Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Node.js
  3. nyc

nyc

ISCJavaScriptnyc-v18.0.0

A command-line interface for Istanbul that instruments JavaScript code to collect test coverage metrics.

Visit WebsiteGitHubGitHub
5.8k stars360 forks0 contributors

What is nyc?

nyc is the command-line interface for Istanbul, a JavaScript code coverage tool. It instruments JavaScript code to track which lines, branches, and functions are executed during tests, generating coverage reports to help developers assess test effectiveness. It supports modern JavaScript features, source maps for transpiled code, and integrates with popular test runners.

Target Audience

JavaScript developers and teams using test runners like Mocha, AVA, or Tape who need to measure and improve their test coverage, especially in projects using Babel or TypeScript.

Value Proposition

Developers choose nyc for its deep integration with the Istanbul ecosystem, extensive configuration options, support for complex scenarios like subprocesses and source maps, and its ability to work with almost any JavaScript test runner without requiring major workflow changes.

Overview

the Istanbul command line interface

Use Cases

Best For

  • Measuring test coverage in Node.js applications
  • Tracking coverage for Babel-transpiled JavaScript projects
  • Generating coverage reports for TypeScript codebases
  • Enforcing coverage thresholds in CI/CD pipelines
  • Combining coverage from multiple test suites or runners
  • Instrumenting code that spawns child processes

Not Ideal For

  • Projects using Jest or Tap as their primary test runner, since these include built-in coverage tools
  • Teams seeking a zero-configuration, out-of-the-box coverage solution with minimal setup
  • Applications requiring real-time coverage feedback during development, as nyc is designed for post-run reporting
  • Small-scale scripts or projects where the overhead of instrumentation and reporting is disproportionate to benefits

Pros & Cons

Pros

Subprocess Coverage

nyc uniquely collects coverage from applications that spawn subprocesses, essential for complex Node.js workflows, as highlighted in the README's key features.

Source Map Support

Accurately handles coverage for Babel and TypeScript projects via source maps, ensuring reports reflect the original source code, as emphasized in the README's description.

Flexible Configuration

Offers multiple configuration methods including CLI, package.json, and various config files, allowing fine-grained control, with examples provided for JSON, YAML, and JS formats.

Coverage Threshold Enforcement

Enables setting custom coverage thresholds to fail builds if not met, integrating seamlessly with CI/CD pipelines, as detailed in the coverage thresholds section.

Cons

Complex Setup for Transpiled Code

Requires additional presets and careful configuration for Babel or TypeScript, which can be error-prone and time-consuming, as the README advises using specific config packages.

Cache Management Issues

The caching feature, while improving performance, can lead to stale coverage data if not properly invalidated, and the README lacks clear guidance on cache invalidation strategies.

Verbose and Scattered Documentation

Advanced features are documented across multiple pages, making it challenging for users to find comprehensive information without deep diving, as seen with links to external tutorials.

Frequently Asked Questions

Quick Stats

Stars5,770
Forks360
Contributors0
Open Issues188
Last commit2 months ago
CreatedSince 2015

Tags

#javascript-testing#unit-testing#cli-tool#typescript#javascript#testing-tools#code-coverage#istanbul#babel

Built With

J
JavaScript
N
Node.js

Links & Resources

Website

Included in

Node.js65.5k
Auto-fetched 5 hours ago

Related Projects

PuppeteerPuppeteer

JavaScript API for Chrome and Firefox

Stars95,335
Forks9,540
Last commit21 hours ago
PlaywrightPlaywright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

Stars93,344
Forks6,139
Last commit5 hours ago
JestJest

Delightful JavaScript Testing.

Stars45,454
Forks6,712
Last commit2 days ago
MochaMocha

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Stars22,904
Forks3,144
Last commit5 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub