# @types/pidusage

> TypeScript definitions for pidusage

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

## Install

```sh
npm install @types/pidusage
pnpm add @types/pidusage
yarn add @types/pidusage
bun add @types/pidusage
```

## 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.5 |
| Published | 2023-11-07 |
| First published | 2017-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

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

## Recent versions

- 2.0.5 (latest) — 2023-11-07
- 2.0.2 (ts3.8) — 2021-12-24
- 2.0.1 (ts2.2) — 2019-01-15
- 1.1.1 (ts2.0) — 2017-08-21
- 2.0.4 — 2023-10-18
- 2.0.3 — 2023-09-24
- 2.0.0 — 2018-08-24
- 1.1.0 — 2017-04-25

## README

# Installation
> `npm install --save @types/pidusage`

# Summary
This package contains type definitions for pidusage (https://github.com/soyuka/pidusage).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pidusage.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pidusage/index.d.ts)
````ts
interface Stat {
    /**
     * percentage (from 0 to 100*vcore)
     */
    cpu: number;

    /**
     * bytes
     */
    memory: number;

    /**
     * PPID
     */
    ppid: number;

    /**
     * PID
     */
    pid: number;

    /**
     * ms user + system time
     */
    ctime: number;

    /**
     * ms since the start of the process
     */
    elapsed: number;

    /**
     * ms since epoch
     */
    timestamp: number;
}

declare function pidusage(pid: number | string, callback: (err: Error | null, stats: Stat) => void): void;
declare function pidusage(
    pid: number | string,
    options: { [key: string]: any },
    callback: (err: Error | null, stats: Stat) => void,
): void;
declare function pidusage(
    pids: Array<number | string>,
    callback: (err: Error | null, stats: { [key: string]: Stat }) => void,
): void;
declare function pidusage(
    pids: Array<number | string>,
    options: { [key: string]: any },
    callback: (err: Error | null, stats: { [key: string]: Stat }) => void,
): void;
declare function pidusage(pid: number | string, options?: { [key: string]: any }): Promise<Stat>;
declare function pidusage(
    pids: Array<number | string>,
    options?: { [key: string]: any },
): Promise<{ [key: string]: Stat }>;

declare namespace pidusage {
    type Status = Stat;

    /**
     * If needed this function can be used to clear the event loop.
     * Indeed, we're registering an interval to free up the in-memory metrics.
     * By calling this, it will clear this interval and all delete all in-memory data
     */
    function clear(): void;
}

export = pidusage;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Cyril Schumacher](https://github.com/cyrilschumacher).

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