
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@bufbuild/protoplugin
Advanced tools
@bufbuild/protoplugin is a package designed to facilitate the creation of plugins for the Buf build system, which is used for working with Protocol Buffers (protobufs). It provides tools and utilities to help developers generate code and manage protobuf schemas more efficiently.
Code Generation
This feature allows you to generate code from protobuf files. You can specify the input protobuf file and the output directory where the generated code should be placed.
const { CodeGenerator } = require('@bufbuild/protoplugin');
const generator = new CodeGenerator();
generator.generate({
protoFile: 'path/to/your.proto',
outputDir: 'path/to/output',
options: { /* generation options */ }
});
Schema Management
This feature helps in managing protobuf schemas. You can load a schema from a file and retrieve it for further processing or validation.
const { SchemaManager } = require('@bufbuild/protoplugin');
const manager = new SchemaManager();
manager.loadSchema('path/to/schema.proto');
const schema = manager.getSchema();
console.log(schema);
Plugin Development
This feature allows you to develop custom plugins for the Buf build system. You can extend the Plugin class and implement your own code generation logic.
const { Plugin } = require('@bufbuild/protoplugin');
class MyCustomPlugin extends Plugin {
constructor() {
super();
}
generateCode(request) {
// Custom code generation logic
}
}
const plugin = new MyCustomPlugin();
plugin.run();
protobufjs is a popular library for working with Protocol Buffers in JavaScript. It provides comprehensive support for parsing, serializing, and generating protobuf messages. Compared to @bufbuild/protoplugin, protobufjs is more focused on general protobuf operations rather than plugin development for the Buf build system.
grpc-tools is a package that provides tools for working with gRPC and Protocol Buffers. It includes a code generator for creating gRPC service stubs and protobuf message classes. While grpc-tools is more focused on gRPC services, @bufbuild/protoplugin is tailored for creating plugins for the Buf build system.
protoc-gen-ts is a plugin for the Protocol Buffers compiler (protoc) that generates TypeScript code from .proto files. It is similar to @bufbuild/protoplugin in that it focuses on code generation, but it is specifically designed for TypeScript, whereas @bufbuild/protoplugin is more general-purpose and integrated with the Buf build system.
This package helps you create your own code generator plugin using the Protobuf-ES plugin framework.
Protobuf-ES is a complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.
In addition to a full Protobuf runtime library, it provides the protoc-gen-es
code generator, which uses a plugin framework to generate base types from
your Protobuf schema. It is fully compatible with both buf
and protoc
compilers.
And now, you can write your own Protobuf-ES compatible plugins using this same
plugin framework with the @bufbuild/protoplugin
package.
With @bufbuild/protoplugin
, you can generate your own TypeScript code tailored
to your project or needs. You also have various options for producing
JavaScript and TypeScript declaration files:
Exercise full control by writing your own JavaScript and declaration file generators in addition to TypeScript.
Generate TypeScript files only and let the framework generate JavaScript and declaration files automatically using our internal TypeScript compiler.
Generate TypeScript files only and bring your own TypeScript compiler, using it to generate JavaScript and declaration files with your own version of TypeScript and your own compiler options.
With @bufbuild/protoplugin
, you have all the tools at your disposal to produce
ECMAScript-compliant code.
Get started now with our plugin documentation.
FAQs
Helps to create your own Protocol Buffers code generators.
The npm package @bufbuild/protoplugin receives a total of 501,503 weekly downloads. As such, @bufbuild/protoplugin popularity was classified as popular.
We found that @bufbuild/protoplugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.