# @types/lcov-parse

> TypeScript definitions for lcov-parse

Latest version **1.0.2** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/lcov-parse
pnpm add @types/lcov-parse
yarn add @types/lcov-parse
bun add @types/lcov-parse
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-11-07 |
| First published | 2022-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/lcov-parse
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lcov-parse
- npm.io page: https://npm.io/package/@types/lcov-parse

## Recent versions

- 1.0.2 (latest) — 2023-11-07
- 1.0.0 (ts3.9) — 2022-03-28
- 1.0.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/lcov-parse`

# Summary
This package contains type definitions for lcov-parse (https://github.com/davglass/lcov-parse).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lcov-parse.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lcov-parse/index.d.ts)
````ts
declare namespace parse {
    /**
     * Line coverage detail
     */
    interface LcovLine {
        line: number;
        hit: number;
    }
    /**
     * Function coverage detail
     */
    interface LcovFunc {
        name: string;
        line: number;
        hit: number;
    }
    /**
     * Branch coverage detail
     */
    interface LcovBranch {
        line: number;
        block: number;
        branch: number;
        taken: number;
    }
    /**
     * Code coverage for lines, functions or branches in a file
     */
    interface LcovPart<T> {
        hit: number;
        found: number;
        details: T[];
    }
    /**
     * Code coverage for a file
     */
    interface LcovFile {
        title: string;
        file: string;
        lines: LcovPart<LcovLine>;
        functions: LcovPart<LcovFunc>;
        branches: LcovPart<LcovBranch>;
    }
    /**
     * Parses an LCOV code coverage string:
     * ```
     *  parse(lcovString, function(err, data) {
     *      //process the data here
     *  });
     * ```
     *
     * @param str LCOV string to parse
     * @param cb Callback: first arg is `null` or error string,
     *                     second arg is parsed data or `undefined` if an error occurred
     */
    function source(str: string, cb: (err: null | string, data: LcovFile[] | undefined) => void): void;
}

/**
 * Parses an LCOV code coverage file:
 * ```
 *  parse('./path/to/file.info', function(err, data) {
 *      //process the data here
 *  });
 * ```
 *
 * The first argument can also be an LCOV string to parse:
 * ```
 *  parse(lcovString, function(err, data) {
 *      //process the data here
 *  });
 * ```
 *
 * @param file Path to the LCOV file or string to parse
 * @param cb Callback: first arg is `null` or error string,
 *                     second arg is parsed data or `undefined` if an error occurred
 */
declare function parse(file: string, cb: (err: null | string, data: parse.LcovFile[] | undefined) => void): void;

export = parse;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:38 GMT
 * Dependencies: none

# Credits
These definitions were written by [Rouslan Placella](https://github.com/roccivic).

---
_Source: https://npm.io/package/@types/lcov-parse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
