# @types/gettext-parser

> TypeScript definitions for gettext-parser

Latest version **9.0.0** (published 2026-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/gettext-parser
pnpm add @types/gettext-parser
yarn add @types/gettext-parser
bun add @types/gettext-parser
```

## 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 | 9.0.0 |
| Published | 2026-01-21 |
| First published | 2020-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51440 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 9.0.0 (latest) — 2026-01-21
- 8.0.0 (ts5.1) — 2025-02-13
- 4.0.4 (ts4.8) — 2023-11-07
- 4.0.2 (ts4.2) — 2022-12-11
- 4.0.1 (ts3.7) — 2021-07-08
- 4.0.0 (ts2.8) — 2020-03-31
- 4.0.3 — 2023-10-18

## README

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

import type { Transform, TransformOptions } from "node:stream";

export interface GetTextComment {
    translator?: string;
    reference?: string;
    extracted?: string;
    flag?: string;
    previous?: string;
}

export interface GetTextTranslation {
    msgctxt?: string;
    msgid: string;
    msgid_plural?: string;
    msgstr: string[];
    comments?: GetTextComment;
    obsolete?: boolean;
}

export interface GetTextTranslationRecord {
    [msgctxt: string]: {
        [msgId: string]: GetTextTranslation;
    };
}

export interface GetTextTranslations {
    charset: string;
    headers: { [headerName: string]: string };
    translations: GetTextTranslationRecord;
    obsolete?: GetTextTranslationRecord;
}

export interface GetTextPoParserOptions {
    defaultCharset?: string;
    validation?: boolean;
}

export interface GetTextPoCompilerOptions {
    foldLength?: number;
    escapeCharacters?: boolean;
    sort?: boolean | ((a: GetTextTranslation, b: GetTextTranslation) => number);
    eol?: string;
}

export interface PoParser {
    parse: (buffer: Buffer | string, options?: GetTextPoParserOptions) => GetTextTranslations;
    compile: (table: GetTextTranslations, options?: GetTextPoCompilerOptions) => Buffer;
    createParseStream: (options?: GetTextPoParserOptions, transformOptions?: TransformOptions) => Transform;
}

export interface MoParser {
    parse: (buffer: Buffer | string, defaultCharset?: string) => GetTextTranslations;
    compile: (table: GetTextTranslations) => Buffer;
}

export const po: PoParser;
export const mo: MoParser;

````

### Additional Details
 * Last updated: Wed, 21 Jan 2026 09:42:20 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Lorent Lempereur](https://github.com/looorent).

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