Utility package for loading .proto files for gRPC, using Protobuf.js. Version 0.5.0 runs on Node >=6 and ships TypeScript types. It provides both async (load) and sync (loadSync) loading of protobuf definitions, returning a package definition object that can be consumed by gRPC libraries (grpc or @grpc/grpc-js). Supports options like keepCase, longs, enums, bytes, defaults, arrays, objects, oneofs, and includeDirs. It is the recommended replacement for the deprecated grpc.load(). Community-maintained, part of the grpc-node monorepo.
npm install grpc-alt-proto-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Loads a .proto file synchronously and creates a gRPC client using @grpc/grpc-js.
Always use grpc.loadPackageDefinition (or @grpc/grpc-js equivalent) to convert the result.
Use @grpc/grpc-js instead of grpc.
Set keepCase: true to preserve original field names.
Use longs: Number for 64-bit integers within safe integer range, or leave default (Long object) for full precision.
Explicitly set enums: String if you need names, or leave default for numbers.
Always pass the package definition to grpc.loadPackageDefinition (or @grpc/grpc-js equivalent).
Install: npm install @grpc/proto-loader
Use const { loadSync } = require('@grpc/proto-loader'); or const protoLoader = require('@grpc/proto-loader'); then protoLoader.loadSync().