New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@pokujs/c8

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pokujs/c8

☔️ A Poku plugin for V8 code coverage using c8.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source
Poku's Logo

@pokujs/c8

Enjoying Poku? Give him a star to show your support

📚 Documentation

☔️ @pokujs/c8 is a Poku plugin for V8 code coverage using c8.

Quickstart

Install

npm i -D @pokujs/c8

Enable the Plugin

// poku.config.js
import { coverage } from '@pokujs/c8';
import { defineConfig } from 'poku';

export default defineConfig({
  plugins: [coverage()],
});

That's it! Run poku and a coverage summary will be printed after your test results.

[!IMPORTANT]

This plugin relies on Node.js' built-in NODE_V8_COVERAGE environment variable to collect coverage data. Bun and Deno do not support this mechanism, so coverage data will not be collected when running tests with these runtimes.

Options

coverage({
  // Reporters
  reporter: ['text', 'lcov'], // default: ['text']

  // File selection
  include: ['src/**'], // default: [] (all files)
  exclude: ['**/*.test.ts'], // default: c8 defaults
  extension: ['.ts', '.js'], // default: c8 defaults

  // Thresholds
  checkCoverage: true, // default: false
  lines: 80, // default: 0
  branches: 80, // default: 0
  functions: 80, // default: 0
  statements: 80, // default: 0
  perFile: false, // default: false

  // Include untested files
  all: true, // default: false
  src: ['src'], // default: [cwd]

  // Experimental
  experimental: ['monocart'], // default: []

  // Output
  reportsDirectory: './coverage', // default: './coverage'
  skipFull: false, // default: false

  // Advanced
  excludeAfterRemap: false, // default: false
  mergeAsync: false, // default: false
  clean: true, // default: true
});

Examples

Basic text coverage

coverage({
  include: ['src/**'],
});

Generate HTML and LCOV reports

coverage({
  include: ['src/**'],
  reporter: ['text', 'html', 'lcov'],
});

Enforce coverage thresholds

Set a single threshold for all metrics at once by passing a number:

coverage({
  include: ['src/**'],
  checkCoverage: 100,
});

Or use true to set individual thresholds for each metric:

coverage({
  include: ['src/**'],
  checkCoverage: true,
  lines: 95,
  branches: 90,
  functions: 85,
  statements: 95,
});

TypeScript coverage

coverage({
  include: ['src/**'],
  extension: ['.ts'],
  all: true,
});

Extending Monocart reporters

npm i -D monocart-coverage-reports
coverage({
  include: ['src/**'],
  reporter: ['v8', 'console-details', 'codecov'],
  experimental: ['monocart'],
});

How It Works

  • setup creates a temp directory and sets NODE_V8_COVERAGE — every test process spawned by Poku automatically writes V8 coverage data
  • teardown uses c8 to generate reports from the collected data, optionally checks thresholds, then cleans up
  • No modification to test commands or runner configuration needed

License

MIT © wellwelwel and contributors.

Keywords

🐷

FAQs

Package last updated on 31 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts