Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bufbuild/buf

Package Overview
Dependencies
Maintainers
10
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufbuild/buf

The buf CLI is a tool for working with Protocol Buffers.

  • 1.32.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
85K
decreased by-38.44%
Maintainers
10
Weekly downloads
 
Created

What is @bufbuild/buf?

@bufbuild/buf is an npm package that provides tools for working with Protocol Buffers (protobufs). It helps in generating code, linting, and managing protobuf files efficiently. The package is part of the Buf ecosystem, which aims to improve the developer experience when working with protobufs.

What are @bufbuild/buf's main functionalities?

Code Generation

This feature allows you to generate code from your protobuf files. You can specify the input directory containing your .proto files, the output directory for the generated code, and the plugins for the desired languages or frameworks.

const { generate } = require('@bufbuild/buf');

async function generateCode() {
  await generate({
    input: 'path/to/proto/files',
    output: 'path/to/output/directory',
    plugins: ['typescript', 'grpc-web']
  });
}

generateCode();

Linting

Linting helps you ensure that your protobuf files adhere to best practices and style guidelines. This feature scans your .proto files and reports any issues or warnings.

const { lint } = require('@bufbuild/buf');

async function lintProtos() {
  const result = await lint({
    input: 'path/to/proto/files'
  });
  console.log(result);
}

lintProtos();

Breaking Change Detection

This feature allows you to detect breaking changes between different versions of your protobuf files. It compares the current version of your .proto files against a previous version and reports any breaking changes.

const { breaking } = require('@bufbuild/buf');

async function checkBreakingChanges() {
  const result = await breaking({
    against: 'path/to/previous/proto/files',
    input: 'path/to/current/proto/files'
  });
  console.log(result);
}

checkBreakingChanges();

Other packages similar to @bufbuild/buf

FAQs

Package last updated on 16 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc