An esbuild plugin that instruments JavaScript/TypeScript source code with Istanbul/nyc code coverage instrumentation during the build process. Version 0.3.0 is the current stable release; the package is updated infrequently with no fixed cadence. It works as an esbuild plugin, applying Istanbul's instrumentation to files matched by configurable filters and loaders (js, jsx, ts, tsx). Unlike alternatives that require Babel or Webpack, this plugin integrates directly with esbuild's fast build pipeline. It ships TypeScript definitions and supports both ESM and CJS environments. Key differentiator: native esbuild integration without additional transform steps.
npm install esbuild-plugin-istanbulNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to instrument TypeScript source with Istanbul coverage using esbuild.
Set loader to match file extension: 'js' for .js, 'jsx' for .jsx, 'ts' for .ts, 'tsx' for .tsx.
Ensure filter regex matches all files you intend to instrument (e.g., /\.(js|jsx|ts|tsx)$/).
Consider using incremental builds or caching mechanisms in development.
Pin exact version in package.json.
Run npm install esbuild-plugin-istanbul and ensure import uses correct named export.
Use import { esbuildPluginIstanbul } from 'esbuild-plugin-istanbul'.Use const { esbuildPluginIstanbul } = require('esbuild-plugin-istanbul').