--- /dev/null
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures as CommonJS module";\r
+\r
+var util = require("../util.js"),\r
+ js = require("./js.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures as a CommonJS module\r
+ * @exports pbjs/targets/commonjs\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var commonjs = module.exports = function(builder, options) {\r
+ options = options || {};\r
+ return [\r
+ "module.exports", options.min ? "=" : " = ",\r
+ "require(", JSON.stringify(options.dependency || "protobufjs"), ")",\r
+ js.build(builder, options)\r
+ ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+commonjs.description = description;\r