Socket
Socket
Sign inDemoInstall

resolve-protobuf-schema

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve-protobuf-schema

Read a protobuf schema from the disk, parse it and resolve all imports


Version published
Weekly downloads
1.5M
increased by1.88%
Maintainers
1
Weekly downloads
 
Created

What is resolve-protobuf-schema?

The resolve-protobuf-schema npm package is used to parse and resolve Protocol Buffers (protobuf) schema definitions. It helps in converting .proto files into JavaScript objects that can be used for further processing or validation.

What are resolve-protobuf-schema's main functionalities?

Parsing .proto files

This feature allows you to read and parse a .proto file into a JavaScript object. The parsed schema can then be used for various purposes such as validation or code generation.

const fs = require('fs');
const resolve = require('resolve-protobuf-schema');

const schema = resolve(fs.readFileSync('path/to/your.proto', 'utf-8'));
console.log(schema);

Resolving imports in .proto files

This feature allows you to resolve imports within .proto files. If your .proto file imports other .proto files, you can provide a custom resolveImport function to handle these imports.

const fs = require('fs');
const resolve = require('resolve-protobuf-schema');

const schema = resolve(fs.readFileSync('path/to/your.proto', 'utf-8'), {
  resolveImport: (importPath) => fs.readFileSync(importPath, 'utf-8')
});
console.log(schema);

Other packages similar to resolve-protobuf-schema

FAQs

Package last updated on 12 Oct 2014

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