diff --git a/messages.js b/messages.js index 27c63c3..4677ab7 100644 --- a/messages.js +++ b/messages.js @@ -1,4 +1,950 @@ -var fs = require('fs') -var protobuf = require('protocol-buffers') +// This file is auto generated by the protocol-buffers cli tool -module.exports = protobuf(fs.readFileSync(__dirname + '/schema.proto', 'utf-8')) +/* eslint-disable quotes */ +/* eslint-disable indent */ +/* eslint-disable no-redeclare */ + +// Remember to `npm install --save protocol-buffers-encodings` +var encodings = require('protocol-buffers-encodings') +var varint = encodings.varint +var skip = encodings.skip + +var Get = exports.Get = { + buffer: true, + encodingLength: null, + encode: null, + decode: null +} + +var Put = exports.Put = { + buffer: true, + encodingLength: null, + encode: null, + decode: null +} + +var Delete = exports.Delete = { + buffer: true, + encodingLength: null, + encode: null, + decode: null +} + +var Batch = exports.Batch = { + buffer: true, + encodingLength: null, + encode: null, + decode: null +} + +var Iterator = exports.Iterator = { + buffer: true, + encodingLength: null, + encode: null, + decode: null +} + +var Callback = exports.Callback = { + buffer: true, + encodingLength: null, + encode: null, + decode: null +} + +var IteratorData = exports.IteratorData = { + buffer: true, + encodingLength: null, + encode: null, + decode: null +} + +defineGet() +definePut() +defineDelete() +defineBatch() +defineIterator() +defineCallback() +defineIteratorData() + +function defineGet () { + var enc = [ + encodings.varint, + encodings.bytes + ] + + Get.encodingLength = encodingLength + Get.encode = encode + Get.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.id)) throw new Error("id is required") + var len = enc[0].encodingLength(obj.id) + length += 1 + len + if (!defined(obj.key)) throw new Error("key is required") + var len = enc[1].encodingLength(obj.key) + length += 1 + len + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.id)) throw new Error("id is required") + buf[offset++] = 8 + enc[0].encode(obj.id, buf, offset) + offset += enc[0].encode.bytes + if (!defined(obj.key)) throw new Error("key is required") + buf[offset++] = 18 + enc[1].encode(obj.key, buf, offset) + offset += enc[1].encode.bytes + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + id: 0, + key: null + } + var found0 = false + var found1 = false + while (true) { + if (end <= offset) { + if (!found0 || !found1) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.id = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + obj.key = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + found1 = true + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } +} + +function definePut () { + var enc = [ + encodings.varint, + encodings.bytes + ] + + Put.encodingLength = encodingLength + Put.encode = encode + Put.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.id)) throw new Error("id is required") + var len = enc[0].encodingLength(obj.id) + length += 1 + len + if (!defined(obj.key)) throw new Error("key is required") + var len = enc[1].encodingLength(obj.key) + length += 1 + len + if (defined(obj.value)) { + var len = enc[1].encodingLength(obj.value) + length += 1 + len + } + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.id)) throw new Error("id is required") + buf[offset++] = 8 + enc[0].encode(obj.id, buf, offset) + offset += enc[0].encode.bytes + if (!defined(obj.key)) throw new Error("key is required") + buf[offset++] = 18 + enc[1].encode(obj.key, buf, offset) + offset += enc[1].encode.bytes + if (defined(obj.value)) { + buf[offset++] = 26 + enc[1].encode(obj.value, buf, offset) + offset += enc[1].encode.bytes + } + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + id: 0, + key: null, + value: null + } + var found0 = false + var found1 = false + while (true) { + if (end <= offset) { + if (!found0 || !found1) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.id = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + obj.key = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + found1 = true + break + case 3: + obj.value = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } +} + +function defineDelete () { + var enc = [ + encodings.varint, + encodings.bytes + ] + + Delete.encodingLength = encodingLength + Delete.encode = encode + Delete.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.id)) throw new Error("id is required") + var len = enc[0].encodingLength(obj.id) + length += 1 + len + if (!defined(obj.key)) throw new Error("key is required") + var len = enc[1].encodingLength(obj.key) + length += 1 + len + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.id)) throw new Error("id is required") + buf[offset++] = 8 + enc[0].encode(obj.id, buf, offset) + offset += enc[0].encode.bytes + if (!defined(obj.key)) throw new Error("key is required") + buf[offset++] = 18 + enc[1].encode(obj.key, buf, offset) + offset += enc[1].encode.bytes + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + id: 0, + key: null + } + var found0 = false + var found1 = false + while (true) { + if (end <= offset) { + if (!found0 || !found1) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.id = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + obj.key = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + found1 = true + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } +} + +function defineBatch () { + var Operation = Batch.Operation = { + buffer: true, + encodingLength: null, + encode: null, + decode: null + } + + defineOperation() + + function defineOperation () { + var enc = [ + encodings.string, + encodings.bytes + ] + + Operation.encodingLength = encodingLength + Operation.encode = encode + Operation.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.type)) throw new Error("type is required") + var len = enc[0].encodingLength(obj.type) + length += 1 + len + if (!defined(obj.key)) throw new Error("key is required") + var len = enc[1].encodingLength(obj.key) + length += 1 + len + if (defined(obj.value)) { + var len = enc[1].encodingLength(obj.value) + length += 1 + len + } + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.type)) throw new Error("type is required") + buf[offset++] = 10 + enc[0].encode(obj.type, buf, offset) + offset += enc[0].encode.bytes + if (!defined(obj.key)) throw new Error("key is required") + buf[offset++] = 18 + enc[1].encode(obj.key, buf, offset) + offset += enc[1].encode.bytes + if (defined(obj.value)) { + buf[offset++] = 26 + enc[1].encode(obj.value, buf, offset) + offset += enc[1].encode.bytes + } + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + type: "", + key: null, + value: null + } + var found0 = false + var found1 = false + while (true) { + if (end <= offset) { + if (!found0 || !found1) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.type = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + obj.key = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + found1 = true + break + case 3: + obj.value = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } + } + + var enc = [ + encodings.varint, + Operation + ] + + Batch.encodingLength = encodingLength + Batch.encode = encode + Batch.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.id)) throw new Error("id is required") + var len = enc[0].encodingLength(obj.id) + length += 1 + len + if (defined(obj.ops)) { + for (var i = 0; i < obj.ops.length; i++) { + if (!defined(obj.ops[i])) continue + var len = enc[1].encodingLength(obj.ops[i]) + length += varint.encodingLength(len) + length += 1 + len + } + } + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.id)) throw new Error("id is required") + buf[offset++] = 8 + enc[0].encode(obj.id, buf, offset) + offset += enc[0].encode.bytes + if (defined(obj.ops)) { + for (var i = 0; i < obj.ops.length; i++) { + if (!defined(obj.ops[i])) continue + buf[offset++] = 18 + varint.encode(enc[1].encodingLength(obj.ops[i]), buf, offset) + offset += varint.encode.bytes + enc[1].encode(obj.ops[i], buf, offset) + offset += enc[1].encode.bytes + } + } + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + id: 0, + ops: [] + } + var found0 = false + while (true) { + if (end <= offset) { + if (!found0) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.id = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + var len = varint.decode(buf, offset) + offset += varint.decode.bytes + obj.ops.push(enc[1].decode(buf, offset, offset + len)) + offset += enc[1].decode.bytes + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } +} + +function defineIterator () { + var Options = Iterator.Options = { + buffer: true, + encodingLength: null, + encode: null, + decode: null + } + + defineOptions() + + function defineOptions () { + var enc = [ + encodings.bool, + encodings.bytes, + encodings.sint64 + ] + + Options.encodingLength = encodingLength + Options.encode = encode + Options.decode = decode + + function encodingLength (obj) { + var length = 0 + if (defined(obj.keys)) { + var len = enc[0].encodingLength(obj.keys) + length += 1 + len + } + if (defined(obj.values)) { + var len = enc[0].encodingLength(obj.values) + length += 1 + len + } + if (defined(obj.gt)) { + var len = enc[1].encodingLength(obj.gt) + length += 1 + len + } + if (defined(obj.gte)) { + var len = enc[1].encodingLength(obj.gte) + length += 1 + len + } + if (defined(obj.lt)) { + var len = enc[1].encodingLength(obj.lt) + length += 1 + len + } + if (defined(obj.lte)) { + var len = enc[1].encodingLength(obj.lte) + length += 1 + len + } + if (defined(obj.limit)) { + var len = enc[2].encodingLength(obj.limit) + length += 1 + len + } + if (defined(obj.reverse)) { + var len = enc[0].encodingLength(obj.reverse) + length += 1 + len + } + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (defined(obj.keys)) { + buf[offset++] = 8 + enc[0].encode(obj.keys, buf, offset) + offset += enc[0].encode.bytes + } + if (defined(obj.values)) { + buf[offset++] = 16 + enc[0].encode(obj.values, buf, offset) + offset += enc[0].encode.bytes + } + if (defined(obj.gt)) { + buf[offset++] = 26 + enc[1].encode(obj.gt, buf, offset) + offset += enc[1].encode.bytes + } + if (defined(obj.gte)) { + buf[offset++] = 34 + enc[1].encode(obj.gte, buf, offset) + offset += enc[1].encode.bytes + } + if (defined(obj.lt)) { + buf[offset++] = 42 + enc[1].encode(obj.lt, buf, offset) + offset += enc[1].encode.bytes + } + if (defined(obj.lte)) { + buf[offset++] = 50 + enc[1].encode(obj.lte, buf, offset) + offset += enc[1].encode.bytes + } + if (defined(obj.limit)) { + buf[offset++] = 56 + enc[2].encode(obj.limit, buf, offset) + offset += enc[2].encode.bytes + } + if (defined(obj.reverse)) { + buf[offset++] = 64 + enc[0].encode(obj.reverse, buf, offset) + offset += enc[0].encode.bytes + } + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + keys: false, + values: false, + gt: null, + gte: null, + lt: null, + lte: null, + limit: 0, + reverse: false + } + while (true) { + if (end <= offset) { + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.keys = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + break + case 2: + obj.values = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + break + case 3: + obj.gt = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + case 4: + obj.gte = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + case 5: + obj.lt = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + case 6: + obj.lte = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + case 7: + obj.limit = enc[2].decode(buf, offset) + offset += enc[2].decode.bytes + break + case 8: + obj.reverse = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } + } + + var enc = [ + encodings.varint, + Options + ] + + Iterator.encodingLength = encodingLength + Iterator.encode = encode + Iterator.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.id)) throw new Error("id is required") + var len = enc[0].encodingLength(obj.id) + length += 1 + len + if (defined(obj.batch)) { + var len = enc[0].encodingLength(obj.batch) + length += 1 + len + } + if (defined(obj.options)) { + var len = enc[1].encodingLength(obj.options) + length += varint.encodingLength(len) + length += 1 + len + } + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.id)) throw new Error("id is required") + buf[offset++] = 8 + enc[0].encode(obj.id, buf, offset) + offset += enc[0].encode.bytes + if (defined(obj.batch)) { + buf[offset++] = 16 + enc[0].encode(obj.batch, buf, offset) + offset += enc[0].encode.bytes + } + if (defined(obj.options)) { + buf[offset++] = 26 + varint.encode(enc[1].encodingLength(obj.options), buf, offset) + offset += varint.encode.bytes + enc[1].encode(obj.options, buf, offset) + offset += enc[1].encode.bytes + } + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + id: 0, + batch: 0, + options: null + } + var found0 = false + while (true) { + if (end <= offset) { + if (!found0) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.id = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + obj.batch = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + break + case 3: + var len = varint.decode(buf, offset) + offset += varint.decode.bytes + obj.options = enc[1].decode(buf, offset, offset + len) + offset += enc[1].decode.bytes + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } +} + +function defineCallback () { + var enc = [ + encodings.varint, + encodings.string, + encodings.bytes + ] + + Callback.encodingLength = encodingLength + Callback.encode = encode + Callback.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.id)) throw new Error("id is required") + var len = enc[0].encodingLength(obj.id) + length += 1 + len + if (defined(obj.error)) { + var len = enc[1].encodingLength(obj.error) + length += 1 + len + } + if (defined(obj.value)) { + var len = enc[2].encodingLength(obj.value) + length += 1 + len + } + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.id)) throw new Error("id is required") + buf[offset++] = 8 + enc[0].encode(obj.id, buf, offset) + offset += enc[0].encode.bytes + if (defined(obj.error)) { + buf[offset++] = 18 + enc[1].encode(obj.error, buf, offset) + offset += enc[1].encode.bytes + } + if (defined(obj.value)) { + buf[offset++] = 26 + enc[2].encode(obj.value, buf, offset) + offset += enc[2].encode.bytes + } + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + id: 0, + error: "", + value: null + } + var found0 = false + while (true) { + if (end <= offset) { + if (!found0) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.id = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + obj.error = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + case 3: + obj.value = enc[2].decode(buf, offset) + offset += enc[2].decode.bytes + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } +} + +function defineIteratorData () { + var enc = [ + encodings.varint, + encodings.string, + encodings.bytes + ] + + IteratorData.encodingLength = encodingLength + IteratorData.encode = encode + IteratorData.decode = decode + + function encodingLength (obj) { + var length = 0 + if (!defined(obj.id)) throw new Error("id is required") + var len = enc[0].encodingLength(obj.id) + length += 1 + len + if (defined(obj.error)) { + var len = enc[1].encodingLength(obj.error) + length += 1 + len + } + if (defined(obj.key)) { + var len = enc[2].encodingLength(obj.key) + length += 1 + len + } + if (defined(obj.value)) { + var len = enc[2].encodingLength(obj.value) + length += 1 + len + } + return length + } + + function encode (obj, buf, offset) { + if (!offset) offset = 0 + if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj)) + var oldOffset = offset + if (!defined(obj.id)) throw new Error("id is required") + buf[offset++] = 8 + enc[0].encode(obj.id, buf, offset) + offset += enc[0].encode.bytes + if (defined(obj.error)) { + buf[offset++] = 18 + enc[1].encode(obj.error, buf, offset) + offset += enc[1].encode.bytes + } + if (defined(obj.key)) { + buf[offset++] = 26 + enc[2].encode(obj.key, buf, offset) + offset += enc[2].encode.bytes + } + if (defined(obj.value)) { + buf[offset++] = 34 + enc[2].encode(obj.value, buf, offset) + offset += enc[2].encode.bytes + } + encode.bytes = offset - oldOffset + return buf + } + + function decode (buf, offset, end) { + if (!offset) offset = 0 + if (!end) end = buf.length + if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid") + var oldOffset = offset + var obj = { + id: 0, + error: "", + key: null, + value: null + } + var found0 = false + while (true) { + if (end <= offset) { + if (!found0) throw new Error("Decoded message is not valid") + decode.bytes = offset - oldOffset + return obj + } + var prefix = varint.decode(buf, offset) + offset += varint.decode.bytes + var tag = prefix >> 3 + switch (tag) { + case 1: + obj.id = enc[0].decode(buf, offset) + offset += enc[0].decode.bytes + found0 = true + break + case 2: + obj.error = enc[1].decode(buf, offset) + offset += enc[1].decode.bytes + break + case 3: + obj.key = enc[2].decode(buf, offset) + offset += enc[2].decode.bytes + break + case 4: + obj.value = enc[2].decode(buf, offset) + offset += enc[2].decode.bytes + break + default: + offset = skip(prefix & 7, buf, offset) + } + } + } +} + +function defined (val) { + return val !== null && val !== undefined && (typeof val !== 'number' || !isNaN(val)) +} diff --git a/package.json b/package.json index 257dc1c..f514d3f 100644 --- a/package.json +++ b/package.json @@ -5,27 +5,23 @@ "main": "index.js", "dependencies": { "abstract-leveldown": "^2.4.1", - "brfs": "^1.4.2", "duplexify": "^3.4.2", "end-of-stream": "^1.1.0", "length-prefixed-stream": "^1.4.0", "levelup": "^1.3.1", "numeric-id-map": "^1.1.0", - "protocol-buffers": "^3.1.4" + "protocol-buffers-encodings": "^1.1.0" }, "devDependencies": { "concat-stream": "^1.5.1", "memdown": "^1.1.0", + "protocol-buffers": "^4.0.2", "standard": "^5.4.1", "tape": "^4.4.0" }, "scripts": { - "test": "standard && tape test/*.js" - }, - "browserify": { - "transform": [ - "brfs" - ] + "test": "standard && tape test/*.js", + "protobuf": "protocol-buffers schema.proto -o messages.js" }, "repository": { "type": "git",