{"id":25357,"library":"esbuild-plugin-istanbul","title":"esbuild-plugin-istanbul","description":"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.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/abraha2d/esbuild-plugin-istanbul","tags":["javascript","typescript"],"install":[{"cmd":"npm install esbuild-plugin-istanbul","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-istanbul","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-istanbul","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to register the plugin","package":"esbuild","optional":false},{"reason":"installs istanbul-lib-instrument for code instrumentation","package":"nyc","optional":false}],"imports":[{"note":"This is a named export, not a default export. Both ESM and CJS work.","wrong":"import esbuildPluginIstanbul from 'esbuild-plugin-istanbul'","symbol":"esbuildPluginIstanbul","correct":"import { esbuildPluginIstanbul } from 'esbuild-plugin-istanbul'"},{"note":"CommonJS destructuring is required because it's a named export.","wrong":"const esbuildPluginIstanbul = require('esbuild-plugin-istanbul')","symbol":"esbuildPluginIstanbul","correct":"const { esbuildPluginIstanbul } = require('esbuild-plugin-istanbul')"},{"note":"TypeScript only; not available at runtime.","wrong":null,"symbol":"PluginOptions","correct":"import type { PluginOptions } from 'esbuild-plugin-istanbul'"}],"quickstart":{"code":"import { esbuildPluginIstanbul } from 'esbuild-plugin-istanbul';\nimport * as esbuild from 'esbuild';\n\nawait esbuild.build({\n  entryPoints: ['src/index.ts'],\n  bundle: true,\n  outdir: 'dist',\n  plugins: [\n    esbuildPluginIstanbul({\n      filter: /\\.tsx?$/,\n      loader: 'ts',\n      name: 'istanbul',\n    }),\n  ],\n});","lang":"typescript","description":"Shows how to instrument TypeScript source with Istanbul coverage using esbuild."},"warnings":[{"fix":"Set loader to match file extension: 'js' for .js, 'jsx' for .jsx, 'ts' for .ts, 'tsx' for .tsx.","message":"Must specify correct loader for file type (js/jsx/ts/tsx). Using wrong loader may break instrumentation.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure filter regex matches all files you intend to instrument (e.g., /\\.(js|jsx|ts|tsx)$/).","message":"The plugin only processes files matched by the filter regex. If filter is too narrow, some files may be skipped.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using incremental builds or caching mechanisms in development.","message":"Instrumentation may significantly slow down builds for large projects.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin exact version in package.json.","message":"Plugin options may change in future minor versions; no deprecation notices yet.","severity":"deprecated","affected_versions":"0.x"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install esbuild-plugin-istanbul and ensure import uses correct named export.","cause":"Package not installed or import path is incorrect.","error":"Error: Cannot find module 'esbuild-plugin-istanbul'"},{"fix":"Use import { esbuildPluginIstanbul } from 'esbuild-plugin-istanbul'.","cause":"Attempting default import instead of named import.","error":"Module 'esbuild-plugin-istanbul' has no default export"},{"fix":"Use const { esbuildPluginIstanbul } = require('esbuild-plugin-istanbul').","cause":"CommonJS require without destructuring returns an object with the function as a property.","error":"TypeError: esbuildPluginIstanbul is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}