@airtap/browserify-istanbul

中文文档
4.0.0发布于 2021/03/08MITCommonJS近 30 天下载 6060

A browserify transform for the istanbul code coverage tool

原始使用文档
文档目录5 节
  1. Installing
  2. Usage
  3. Command line
  4. Interacting With Coverage Reports
  5. License

browserify-istanbul

A browserify transform for the istanbul code coverage tool.

This is a temporary fork that includes devongovett/browserify-istanbul#45 until that lands upstream.

Installing

npm install --save-dev @airtap/browserify-istanbul

Usage

There are several ways to register browserify transforms: on the command line, in your package.json, or using the browserify API. You can use all of these with browserify-istanbul: see the browserify docs for more info.

There are a few options available to browserify-istanbul when you use it from JavaScript. They are shown in the following code example:

var istanbul = require('@airtap/browserify-istanbul');

// use without any options...
browserifyBundle.transform(istanbul);

// or with some options...
browserifyBundle.transform(istanbul({
  // ignore these glob paths (the ones shown are the defaults)
  ignore: ['**/node_modules/**', '**/bower_components/**', '**/test/**', '**/tests/**', '**/*.json'],

  // by default, any paths you include in the ignore option are ignored
  // in addition to the defaults. set the defaultIgnore option to false
  // to only ignore the paths you specify.
  defaultIgnore: true
}));

Command line

  • without options:
./node_modules/.bin/browserify -t @airtap/browserify-istanbul test/test-*.js -o bundle.js
  • with options
./node_modules/.bin/browserify -t [ @airtap/browserify-istanbul --ignore "**/bower_components/**" ] test/test-*.js -o bundle.js

Interacting With Coverage Reports

To load and manipulate coverage reports, the command line tool nyc can be used:

  1. output the the __coverage__ object to ./.nyc_output/coverage.json.
  1. execute nyc with a list of reporters.
  • nyc report --reporter=lcov --reporter=text-summary.

See istanbul.js.org for more examples and documentation.

License

MIT

版本与发布记录

@airtap/browserify-istanbul 共发布 1 个版本,首次发布于 2021/03/08;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.0.0latest2021/03/085 年前

关于 @airtap/browserify-istanbul 的常见问题

@airtap/browserify-istanbul 是什么?

A browserify transform for the istanbul code coverage tool

如何安装 @airtap/browserify-istanbul?

在项目目录运行 npm install @airtap/browserify-istanbul,或使用 pnpm add / yarn add / bun add。

@airtap/browserify-istanbul 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/airtap__browserify-istanbul 是否存在。

@airtap/browserify-istanbul 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@airtap/browserify-istanbul 可以商用吗?

@airtap/browserify-istanbul 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@airtap/browserify-istanbul 的下载量有多少?

根据 npm 官方下载统计,@airtap/browserify-istanbul 在 2026/10/05 – 2026/11/03 这 30 天内被下载 6,060 次,日均约 202 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@airtap/browserify-istanbul 还在维护吗?

最新版本 4.0.0 发布于 2021/03/08(5 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/03/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。