From 6f8f2c1fdf92e6f81363d77bc059820b2376fe32 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Thu, 23 Mar 2017 05:25:00 +0100 Subject: [PATCH] Docs: Added a hint on using .create to initial example [ci skip] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa8f1d68f..9f9045fb5 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ protobuf.load("awesome.proto", function(err, root) { throw err; // Obtain a message type - var AwesomeMessage = root.lookup("awesomepackage.AwesomeMessage"); + var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); // Exemplary payload var payload = { awesomeField: "AwesomeString" }; @@ -194,7 +194,7 @@ protobuf.load("awesome.proto", function(err, root) { throw Error(errMsg); // Create a new message - var message = AwesomeMessage.fromObject(payload); + var message = AwesomeMessage.fromObject(payload); // or use .create if payload is already known to be valid // Encode a message to an Uint8Array (browser) or Buffer (node) var buffer = AwesomeMessage.encode(message).finish();