Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / grpc-cloned / node_modules / @protobufjs / codegen / README.md
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/README.md
new file mode 100644 (file)
index 0000000..0169338
--- /dev/null
@@ -0,0 +1,49 @@
+@protobufjs/codegen\r
+===================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/codegen.svg)](https://www.npmjs.com/package/@protobufjs/codegen)\r
+\r
+A minimalistic code generation utility.\r
+\r
+API\r
+---\r
+\r
+* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**<br />\r
+  Begins generating a function.\r
+\r
+* **codegen.verbose = `false`**<br />\r
+  When set to true, codegen will log generated code to console. Useful for debugging.\r
+\r
+Invoking **codegen** returns an appender function that appends code to the function's body and returns itself:\r
+\r
+* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**<br />\r
+  Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters:\r
+\r
+  * `%d`: Number (integer or floating point value)\r
+  * `%f`: Floating point value\r
+  * `%i`: Integer value\r
+  * `%j`: JSON.stringify'ed value\r
+  * `%s`: String value\r
+  * `%%`: Percent sign<br />\r
+\r
+* **Codegen([scope: `Object.<string,*>`]): `Function`**<br />\r
+  Finishes the function and returns it.\r
+\r
+* **Codegen.toString([functionNameOverride: `string`]): `string`**<br />\r
+  Returns the function as a string.\r
+\r
+Example\r
+-------\r
+\r
+```js\r
+var codegen = require("@protobufjs/codegen");\r
+\r
+var add = codegen(["a", "b"], "add") // A function with parameters "a" and "b" named "add"\r
+  ("// awesome comment")             // adds the line to the function's body\r
+  ("return a + b - c + %d", 1)       // replaces %d with 1 and adds the line to the body\r
+  ({ c: 1 });                        // adds "c" with a value of 1 to the function's scope\r
+\r
+console.log(add.toString()); // function add(a, b) { return a + b - c + 1 }\r
+console.log(add(1, 2));      // calculates 1 + 2 - 1 + 1 = 3\r
+```\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r