npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fyn-software/protoc-plugin-ts

v0.8.13

Published

Compile protocol buffers descriptors to Typescript.

Downloads

71

Readme

Protoc Plugin Typescript

Release npm npm

Aim of this protoc plugin is to make usage of protocol buffers easy in Javascript/Typescript by taking modern approaches. This plugin generates plain Typescript files that can be used AMD, UMD, CommonJS module systems.

Example

syntax = "proto3";

message Author {
    string name = 1;
    string role = 2;
}

message Change {
    Kind kind = 1;
    string patch = 2;
    repeated string tags = 3; 
    oneof name_or_id {
        string name = 4;
        string id = 5;
    }
    Author author = 6;
}

enum Kind {
    UPDATED = 0;
    DELETED = 1;
}
// Constructed message
const change = new Change({
    kind: Kind.UPDATED,
    patch: "@@ -7,11 +7,15 @@",
    tags: ["no prefix", "as is"],
    name: "patch for typescript 4.5",
    author: new Author({
        name: "mary poppins",
        role: "maintainer"
    })
});

// Sent over the wire
const bytes: Uint8Array = change.serialize();

const receivedChange: Change = Change.deserialize(bytes);

console.log(receivedChange.kind == Kind.UPDATED) // true
console.log(receivedChange.patch) // "@@ -7,11 +7,15 @@"
console.log(receivedChange.tags) // ["no prefix", "as is"]
console.log(receivedChange.name) // "patch for typescript 4.5"
// see which one of the fields were filled
console.log(receivedChange.name_or_id) // "name"
console.log(receivedChange.author.name) // "mary poppins"

Usage

npm install -g @fyn-software/protoc-plugin-ts

protoc -I=sourcedir --ts_out=dist myproto.proto

Supported Options

| option | type | default | details | |-----------------------|--------------------------|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ~~unary_rpc_promise~~ | bool | false | This option is here for legacy reasons, see thesayyn/protoc-gen-ts for details | | grpc_package | string | @fynsoftware/grpc | you can specify which package to import | | style | 'async' or 'grpc-js' | 'async' | you can determine the style of generated codeasync is meant to be compatible with @fynsoftware/grpcgrpc-js is meant to be compatible with @grpc/grpc-js | | no_namespace | bool | true | you can enable/disable the generation of top-level namespace |

Alternatives

This project is forked from thesayyn/protoc-gen-ts. If you prefer a larger community over the async interface generation simply use that over this.

Development

Generates appropriate Protocol Buffer sources from Proto files directly through TypeScript Compiler API.

# when you make changes to the plugin, you will have to run the command below
npm run build
# then invoke the tests
npm test