# @types/parse-torrent-file

> TypeScript definitions for parse-torrent-file

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

## Install

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

## 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 | 4.0.6 |
| Published | 2023-11-07 |
| First published | 2017-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51450 |
| Maintainers | types |

## Links

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

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 4.0.6 (latest) — 2023-11-07
- 4.0.3 (ts3.6) — 2021-07-08
- 4.0.2 (ts2.0) — 2019-02-13
- 4.0.5 — 2023-10-18
- 4.0.4 — 2023-09-24
- 4.0.1 — 2017-03-24
- 4.0.0 — 2017-01-19

## README

# Installation
> `npm install --save @types/parse-torrent-file`

# Summary
This package contains type definitions for parse-torrent-file (https://github.com/webtorrent/parse-torrent-file).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-torrent-file.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-torrent-file/index.d.ts)
````ts
/// <reference types="node" />

declare function ParseTorrentFile(torrent: Buffer | ParseTorrentFile.Torrent): ParseTorrentFile.Instance;

declare namespace ParseTorrentFile {
    function decode(torrent: Buffer | Torrent): Instance;
    function encode(parsed: Instance): Buffer;

    interface TorrentInfo {
        "name.utf-8"?: string | undefined;
        name?: string | undefined;
        files?: File[] | undefined;
        "piece length"?: number | undefined;
        pieces?: number | undefined;
        private?: boolean | undefined;
    }

    interface Torrent {
        info?: TorrentInfo | undefined;
        "creation date"?: number | undefined;
        "created by"?: string | undefined;
        comment?: Buffer | undefined;
        "announce-list"?: string[][] | undefined;
        announce?: string | undefined;
        "url-list"?: Buffer | undefined;
    }

    interface ParsedFile {
        path: string;
        name: string;
        length: number;
        offset: number;
    }

    interface Instance extends Object {
        info?: TorrentInfo | undefined;
        infoBuffer?: Buffer | undefined;
        infoHash?: string | undefined;
        infoHashBuffer?: Buffer | undefined;
        name?: string | undefined;
        private?: boolean | undefined;
        created?: Date | undefined;
        createdBy?: string | undefined;
        announce?: string[] | undefined;
        urlList?: string[] | undefined;
        pieceLength?: number | undefined;
        lastPieceLength?: number | undefined;
        pieces?: string[] | undefined;
        length?: number | undefined;
        files?: ParsedFile[] | undefined;
    }
}

export = ParseTorrentFile;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Tomasz Łaziuk](https://github.com/tlaziuk).

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