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

protocol-buffers

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protocol-buffers - npm Package Compare versions

Comparing version 4.1.2 to 4.2.0

5

bin.js

@@ -8,2 +8,3 @@ #!/usr/bin/env node

var watch = false
var encodings = null

@@ -22,2 +23,4 @@ // handrolled parser to not introduce minimist as this is used a bunch of prod places

watch = true
} else if (n === '--encodings' || n === '-e') {
encodings = v === n ? process.argv[++i] : v.split('=').slice(1).join('=')
}

@@ -52,3 +55,3 @@ }

function compile () {
return protobuf.toJS(fs.readFileSync(filename))
return protobuf.toJS(fs.readFileSync(filename), { encodings })
}

7

compile-to-js.js

@@ -18,4 +18,5 @@ var os = require('os')

function compile (messages) {
function compile (messages, opts) {
var out = ''
var encodings = opts && opts.encodings

@@ -29,4 +30,4 @@ out += '// This file is auto generated by the protocol-buffers compiler' + os.EOL

out += os.EOL
out += '// Remember to `npm install --save protocol-buffers-encodings`' + os.EOL
out += 'var encodings = require(\'protocol-buffers-encodings\')' + os.EOL
if (!encodings) out += '// Remember to `npm install --save protocol-buffers-encodings`' + os.EOL
out += 'var encodings = require(\'' + (encodings || 'protocol-buffers-encodings') + '\')' + os.EOL
out += 'var varint = encodings.varint' + os.EOL

@@ -33,0 +34,0 @@ out += 'var skip = encodings.skip' + os.EOL

@@ -40,4 +40,4 @@ var schema = require('protocol-buffers-schema')

module.exports.toJS = function (proto) {
return compileToJS(module.exports(proto, { inlineEnc: true }))
module.exports.toJS = function (proto, opts) {
return compileToJS(module.exports(proto, { inlineEnc: true }), opts)
}
{
"name": "protocol-buffers",
"version": "4.1.2",
"version": "4.2.0",
"description": "Protocol Buffers for Node.js",

@@ -5,0 +5,0 @@ "repository": {

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