LCOV 解析器
快速零依赖性LCOV覆盖报告解析器,以Node.js的TypeScript写成,有无害环境管理/共同JS 支持和流出 API.
此解析器是为 LCOV 微量文件格式所构建的, 可以找到 这里: github.com/linux-test-project/lcov/docs/man/geninfo.rst (英语)。 。 。 .
必要时可以使用不同的字段名.
为什么是这个解剖器?
lcov-parse | parse-lcov | @friedemannsommer/lcov-parser | |
|---|---|---|---|
| 上次更新 | 2017 (英语) | 2020 (英语) | 2026 (英语) |
| LCOV 版本 | 1.x 运算 | 1.x 运算 | 最多2.5岁 |
| 类型脚本 | 否(社区) @types/lcov-parse(中文(简体) ) | 有(本土) | 有(本土) |
| 模块格式 | 仅限普通JS | 仅限普通JS | 无害环境管理+通用JS(双包) |
| 依赖关系 | 0 个 | 0 个 | 0 个 |
| 输入类型 | string (文件路径或内容) | string | string, (中文(简体) ), Buffer, (中文(简体) ), ArrayBuffer, (中文(简体) ), Readable 流线 |
| API 样式 | 回调 | 同步 | 同步,承诺,流 |
安装
npm install --save-dev --save-exact @friedemannsommer/lcov-parser
或短等同物:
npm i -DE @friedemannsommer/lcov-parser
基本用途
string 数据
import lcovParser from "@friedemannsommer/lcov-parser/sync";
const sections = lcovParser({ from: "<LCOV data>" });
Buffer 编号 : ArrayBuffer
import lcovParser from "@friedemannsommer/lcov-parser/sync";
const sections = lcovParser({ from: Buffer.from("<LCOV data>") });
Readable 溪流
import lcovParser from "@friedemannsommer/lcov-parser";
import { createReadStream } from "node:fs";
const lcovFile = createReadStream(new URL("path/to/lcov.info", import.meta.url));
const sections = await lcovParser({ from: lcovFile });
详情请看文件, 此处可见: frodemann sommer.github.io/lcov-parser 互联网档案馆的存檔,存档日期2013-12-02。 。 。 .