# @types/python-struct

> TypeScript definitions for python-struct

Latest version **1.0.5** (published 2025-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/python-struct
pnpm add @types/python-struct
yarn add @types/python-struct
bun add @types/python-struct
```

## Health

**Score 70/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2025-10-24 |
| First published | 2019-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

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

## Dependencies (2)

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

## Recent versions

- 1.0.5 (latest) — 2025-10-24
- 1.0.4 (ts5.1) — 2023-11-07
- 1.0.1 (ts4.3) — 2022-08-10
- 1.0.0 (ts3.5) — 2019-08-12
- 1.0.3 — 2023-10-18
- 1.0.2 — 2023-09-24

## README

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

import Long = require("long");

export type DataType = number | Long | string | boolean;

export function pack(format: string, data: DataType[]): Buffer;
export function pack(format: string, ...data: DataType[]): Buffer;
export function sizeOf(format: string): number;
export function unpack(
    format: string,
    data: Buffer,
    checkBounds?: boolean,
): DataType[];
export function unpackFrom(
    format: string,
    data: Buffer,
    checkBounds: boolean | undefined,
    position: number,
): DataType;

````

### Additional Details
 * Last updated: Fri, 24 Oct 2025 04:02:41 GMT
 * Dependencies: [@types/long](https://npmjs.com/package/@types/long), [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Florian Keller](https://github.com/ffflorian).

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