@escover/converter-istanbul

中文文档
1.0.3发布于 2026/05/16MITES Module近 30 天下载 2489

Istanbul converter

原始使用文档
文档目录13 节
  1. Why another coverage tool?
  2. 🤷‍ What test runner does no transpiling to CommonJS ?
  3. 🤷‍ How to get coverage when nyc doesn't supported?
  4. 🤷‍ How to get coverage when mocks are used?
  5. 🤷‍ What with coveralls ? Does lcov supported?
  6. Install
  7. Comparison with c8
  8. Config
  9. How it looks like?
  10. What formatters exists?
  11. Env
  12. What should I know about lcov ?
  13. License

🎩ESCover License NPM version Build Status Coverage Status

Coverage for EcmaScript Modules based on 🐊Putout and loaders.

Why another coverage tool?

When you want to use ESM in Node.js without transpiling to CommonJS (that's what jest, ava, tap does), you have a couple problems to solve.

🤷‍ What test runner does no transpiling to CommonJS?

☝️ that's easy! 📼 Supertape supports ESM from the box;

🤷‍ How to get coverage when nyc doesn't supported?

☝️ c8 could help, but no it supports no query parameters which are needed to load module again, and apply mocks.

🤷‍ How to get coverage when mocks are used?

☝️ Use 🎩ESCover! It supports loaders, ESM and collects coverage as a loader!

🤷‍ What with coveralls? Does lcov supported?

☝️ Sure! coverage/lcov.info is main coverage file for 🎩ESCover.

Install

npm i escover -D

Run to collect and show coverage:

escover npm test

Comparison with c8

Check out the real example from wisdom. There is next uncovered code:

import {jessy} from 'jessy';

export default (info) => typeof jessy('publishConfig.access', info) === 'undefined';

c8 shows three columns with 100% and one with 0%.

image

And here is what you will see with 🎩ESCover:

image

So if you need more accurate code with no bullshit green 100%, use 🎩ESCover 😉.

Config

exclude section of configuration file .nyrc.json supported.

How it looks like?

When everything is covered:

image

What formatters exists?

There is two types of formatters:

  • lines adds links to each line;
  • files shows information in table;

You can choose formatter with ESCOVER_FORMAT env variable.

Env

If you want to disable coverage on status code without erroring, use ESCOVER_SUCCESS_EXIT_CODE:

import {SKIPPED} from 'supertape/exit-codes';

const env = {
    ESCOVER_SUCCESS_EXIT_CODE: SKIPPED,
};

export default {
    test: () => [env, `escover tape 'test/**/*.js' 'lib/**/*.spec.js'`],
};

What should I know about lcov?

Format used by 🎩ESCover located in coverage/lcov.info.

  • ☝️ lcov was created in 2002, twenty years ago.
  • ☝️ Linux kernel developers created it to know what is going on with the coverage.
  • ☝️ It's written in PERL and has text based format.
  • ☝️ This is most popular coverage format of all times supported by a lot of tools (like coveralls).

When you run your ESM application with:

escover npm test

You will receive something similar to:

SF:/Users/coderaiser/escover/lib/transform.js
DA:1,1
DA:3,1
DA:7,1
DA:9,1
DA:10,1
DA:12,1
DA:24,1
DA:25,1
DA:27,1
DA:28,1
DA:29,1
DA:32,1
end_of_record

Where:

  • SF - is path to source;
  • DA - is line number, and count of running;
  • end_of_record latest recorded for current file entry;

The only thing that is differ from lcov: counters are 0 or 1, if you have a reason to use "real" counters create an issue.

It can be added in one line of code, but I see no reason why it can be useful 🤷‍♂️.

License

MIT

版本与发布记录

@escover/converter-istanbul 共发布 4 个版本,首次发布于 2026/05/13;过去 12 个月发布了 4 个版本。

版本发布日期距今
1.0.3latest2026/05/165 个月前
1.0.22026/05/155 个月前
1.0.12026/05/155 个月前
1.0.02026/05/136 个月前

关于 @escover/converter-istanbul 的常见问题

@escover/converter-istanbul 是什么?

Istanbul converter

如何安装 @escover/converter-istanbul?

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

@escover/converter-istanbul 支持 TypeScript 吗?

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

@escover/converter-istanbul 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@escover/converter-istanbul 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@escover/converter-istanbul 可以商用吗?

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

@escover/converter-istanbul 的下载量有多少?

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

@escover/converter-istanbul 还在维护吗?

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