# @types/istanbul-lib-hook

> TypeScript definitions for istanbul-lib-hook

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

## Install

```sh
npm install @types/istanbul-lib-hook
pnpm add @types/istanbul-lib-hook
yarn add @types/istanbul-lib-hook
bun add @types/istanbul-lib-hook
```

## 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 | 2.0.4 |
| Published | 2023-11-07 |
| First published | 2017-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

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

## Recent versions

- 2.0.4 (latest) — 2023-11-07
- 2.0.1 (ts3.0) — 2020-05-15
- 2.0.0 (ts2.4) — 2019-06-08
- 2.0.3 — 2023-10-18
- 2.0.2 — 2023-09-26
- 1.0.1 — 2019-04-25
- 1.0.0 — 2017-08-31

## README

# Installation
> `npm install --save @types/istanbul-lib-hook`

# Summary
This package contains type definitions for istanbul-lib-hook (https://istanbul.js.org).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-hook.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-hook/index.d.ts)
````ts
export interface Options {
    verbose: boolean;
}

export interface HookRequireOptions extends Options {
    extensions: string[];
    postLoadHook(filename: string): void;
}

export function hookRequire(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<HookRequireOptions>,
): () => void;

export function hookCreateScript(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<Options>,
): void;

export function unhookCreateScript(): void;

export function hookRunInThisContext(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<Options>,
): void;

export function unhookRunInThisContext(): void;

export function hookRunInContext(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<HookRunInContextOptions>,
): void;

export function unhookRunInContext(): void;

export function unloadRequireCache(matcher: Matcher): void;

export type Matcher = (filename: string) => boolean;
export type Transformer = (code: string, options: TransformerOptions) => string;

export interface TransformerOptions {
    filename: string;
}

export interface HookRunInContextOptions extends Options {
    coverageVariable: string;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Jason Cheatham](https://github.com/jason0x43).

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