# @types/protoc-plugin

> TypeScript definitions for protoc-plugin

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

## Install

```sh
npm install @types/protoc-plugin
pnpm add @types/protoc-plugin
yarn add @types/protoc-plugin
bun add @types/protoc-plugin
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2025-10-24 |
| First published | 2019-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51440 |
| Maintainers | types |

## Links

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

## Dependencies (2)

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

## Recent versions

- 0.0.6 (latest) — 2025-10-24
- 0.0.5 (ts5.1) — 2023-11-21
- 0.0.1 (ts3.6) — 2020-05-15
- 0.0.0 (ts2.9) — 2019-03-14
- 0.0.4 — 2023-11-07
- 0.0.3 — 2023-10-18
- 0.0.2 — 2023-09-24

## README

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

import {
    CodeGeneratorRequest as pb_CodeGeneratorRequest,
    CodeGeneratorResponse as pb_CodeGeneratorResponse,
} from "google-protobuf/google/protobuf/compiler/plugin_pb";
import { FileDescriptorProto, SourceCodeInfo } from "google-protobuf/google/protobuf/descriptor_pb";
import stream = require("stream");
import Location = SourceCodeInfo.Location;

type OutputFiles = pb_CodeGeneratorResponse.File.AsObject[];
type SimplePluginCallback = (
    filesToGenerate: readonly FileDescriptorProto.AsObject[],
) => OutputFiles | Promise<OutputFiles>;

declare function simplePlugin(cb: SimplePluginCallback): Promise<void>;
declare namespace simplePlugin {
    function CodeGeneratorRequest(stdin?: stream.Readable): Promise<pb_CodeGeneratorRequest>;
    function CodeGeneratorResponse(stdout?: stream.Writable): (files: OutputFiles) => void;
    function CodeGeneratorResponseError(stdout?: stream.Writable): (err: Error) => void;
    function findCommentByPath(path: number[], locationList: Location.AsObject[]): string;
}

export = simplePlugin;

````

### Additional Details
 * Last updated: Fri, 24 Oct 2025 04:02:41 GMT
 * Dependencies: [@types/google-protobuf](https://npmjs.com/package/@types/google-protobuf), [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Jonny Reeves](https://github.com/jonnyreeves).

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