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

@indutny/protopiler

v2.0.6

Published

Fast zero-dependency protocol buffer parser

Downloads

2,900

Readme

@indutny/protopiler

Just because there are many existing protobuf libraries for JavaScript it doesn't mean that I'm not allowed to create one more.

Selling Points

When compared to protobufjs this library:

  • Faster (+5% decode/+32% encode)
  • No 3rd party dependencies
  • Almost instant compilation
  • 2x smaller produced code (after minification)
  • Native big integer support
  • Native typescript support (via generated .d.ts file)
  • Unknown field support
  • No classes or prototype inheritance. Just plain JS objects in and out.

Unsupported features

This is unambitious project so we do not intend to support (at least for now):

  • rpc
  • map<a, b>
  • protobuf editions
  • extensions/custom options
  • ...and probably a lot of other things!

However we do support what we consider to be a typical protobuf usage (scalar, repeated, oneof fields; enums, messages, bytes, strings).

Installation

npm install -g @indutny/protopiler

Usage

To compile source protobuf files into javascript run:

protopiler my.proto --output out.mjs --typedefs out.d.mts

If my.proto has the following contents:

package test;

message MyMessage {
  string key = 1;
  repeated uint32 values = 2;
}

The following JS snippet could be used to encode/decode the MyMessage:

import { test } from './out.mjs';

// Encode JS object into a Uint8Array
const data = test.MyMessage.encode({
  key: 'test-key',
  values: [1, 2, 3],
});

// Decode Uint8Array back into a JS object
const decoded = test.MyMessage.decode(data);
console.log(decoded);
// Prints:
// { '$unknown': [], key: 'test-key', values: [ 1, 2, 3 ] }

Benchmarks

On MacBook Air M2:

$ pnpm install
$ cd benchmarks
$ pnpm start -d 60 -s 1000
protobuf.mjs/decode:   2’386’421.9 ops/sec (±9’533.9, p=0.001, o=68/1000) severe outliers=44
protopiler.mjs/decode: 2’922’101.3 ops/sec (±4’707.1, p=0.001, o=17/1000) severe outliers=1
protobuf.mjs/encode:   1’085’274.8 ops/sec (±1’928.4, p=0.001, o=50/1000) severe outliers=29
protopiler.mjs/encode: 1’380’961.1 ops/sec (±1’598.2, p=0.001, o=13/1000) severe outliers=1

LICENSE

This software is licensed under the MIT License.