@types/node-memwatch
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Installation

npm install --save @types/node-memwatch

Summary

This package contains type definitions for node-memwatch (https://github.com/eduardbcom/node-memwatch#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-memwatch.

index.d.ts

/// <reference types="node" />

import { EventEmitter } from "events";

export = memwatch;

declare const memwatch: memwatch.MemWatch;

/**
 * Compare the state of your heap between two points in time, telling you what has been allocated, and what has been released.
 */
declare class HeapDiff {
    constructor();

    /**
     * Compute the diff.
     */
    end: () => memwatch.HeapDiffInformation;
}

declare namespace memwatch {
    interface MemWatch extends EventEmitter {
        on(eventName: "leak", callback: (event: LeakInformation) => void): this;
        on(eventName: "stats", callback: (event: StatsInformation) => void): this;

        /**
         * Force V8 to do a full GC and heap compaction.
         *
         * It's intended to be used for debugging. Calling it in production is highly discouraged.
         */
        gc(): void;

        HeapDiff: typeof HeapDiff;
    }

    interface StatsInformation {
        current_base: number;
        estimated_base: number;
        heap_compactions: number;
        max: number;
        min: number;
        num_full_gc: number;
        num_inc_gc: number;
        usage_trend: number;
    }

    interface LeakInformation {
        /**
         * Amount of heap growth in bytes.
         */
        growth: number;

        /**
         * Human-readable description.
         */
        reason: string;
    }

    interface HeapDiffInformation {
        before: HeapDiffSnapshot;
        after: HeapDiffSnapshot;
        change: HeapDiffChange;
    }

    interface HeapDiffSnapshot {
        nodes: number;
        size_bytes: number;
        size: string;
    }

    interface HeapDiffChange {
        size_bytes: number;
        size: string;
        freed_nodes: number;
        allocated_nodes: number;
        details: HeapDiffDetail[];
    }

    interface HeapDiffDetail {
        what: string;
        size_bytes: number;
        size: string;
        "+": number;
        "-": number;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Eunchong Yu.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.4146ts5.7
1.0.4146ts5.6
1.0.4146latest
1.0.4146ts4.5
1.0.4146ts4.6
1.0.4146ts4.7
1.0.4146ts4.8
1.0.4146ts4.9
1.0.4146ts5.0
1.0.4146ts5.1
1.0.4146ts5.2
1.0.4146ts5.3
1.0.4146ts5.4
1.0.4146ts5.5
1.0.4146ts5.8
1.0.12ts2.0
1.0.12ts2.1
1.0.12ts2.2
1.0.12ts2.3
1.0.12ts2.4
1.0.12ts2.5
1.0.12ts2.6
1.0.12ts2.7
1.0.12ts2.8
1.0.12ts2.9
1.0.12ts3.0
1.0.12ts3.1
1.0.12ts3.2
1.0.12ts3.3
1.0.12ts3.4
1.0.12ts3.5
1.0.12ts3.6
1.0.12ts3.7
1.0.12ts3.8
1.0.12ts3.9
1.0.12ts4.0
1.0.12ts4.1
1.0.12ts4.2
1.0.12ts4.3
1.0.12ts4.4

Version History

VersionDownloads (Last 7 Days)Published
1.0.4146
1.0.33
1.0.22
1.0.12
1.0.01

Package Sidebar

Install

npm i @types/node-memwatch

Weekly Downloads

72

Version

1.0.4

License

MIT

Unpacked Size

6.6 kB

Total Files

5

Last publish

Collaborators

  • types