protobufjs 6.8.5 → 6.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +39 -39
  3. package/README.md +879 -879
  4. package/cli/LICENSE +33 -33
  5. package/cli/README.md +11 -11
  6. package/cli/index.d.ts +3 -3
  7. package/cli/index.js +3 -3
  8. package/cli/lib/tsd-jsdoc/LICENSE +20 -20
  9. package/cli/lib/tsd-jsdoc/README.md +23 -23
  10. package/cli/lib/tsd-jsdoc/plugin.js +21 -21
  11. package/cli/lib/tsd-jsdoc/publish.js +693 -693
  12. package/cli/lib/tsd-jsdoc.json +18 -18
  13. package/cli/package.standalone.json +31 -31
  14. package/cli/pbjs.d.ts +9 -9
  15. package/cli/pbjs.js +329 -319
  16. package/cli/pbts.d.ts +9 -9
  17. package/cli/pbts.js +197 -168
  18. package/cli/targets/json-module.js +38 -38
  19. package/cli/targets/json.js +8 -8
  20. package/cli/targets/proto.js +326 -326
  21. package/cli/targets/proto2.js +10 -10
  22. package/cli/targets/proto3.js +10 -10
  23. package/cli/targets/static-module.js +29 -29
  24. package/cli/targets/static.js +702 -705
  25. package/cli/util.js +183 -183
  26. package/cli/wrappers/amd.js +7 -7
  27. package/cli/wrappers/closure.js +7 -7
  28. package/cli/wrappers/commonjs.js +7 -7
  29. package/cli/wrappers/default.js +15 -15
  30. package/cli/wrappers/es6.js +5 -5
  31. package/dist/README.md +31 -31
  32. package/dist/light/README.md +31 -31
  33. package/dist/light/protobuf.js +6031 -6011
  34. package/dist/light/protobuf.js.map +1 -1
  35. package/dist/light/protobuf.min.js +3 -3
  36. package/dist/light/protobuf.min.js.map +1 -1
  37. package/dist/minimal/README.md +31 -31
  38. package/dist/minimal/protobuf.js +1877 -1868
  39. package/dist/minimal/protobuf.js.map +1 -1
  40. package/dist/minimal/protobuf.min.js +3 -3
  41. package/dist/minimal/protobuf.min.js.map +1 -1
  42. package/dist/protobuf.js +7594 -7573
  43. package/dist/protobuf.js.map +1 -1
  44. package/dist/protobuf.min.js +3 -3
  45. package/dist/protobuf.min.js.map +1 -1
  46. package/ext/debug/README.md +4 -4
  47. package/ext/debug/index.js +71 -71
  48. package/ext/descriptor/README.md +72 -72
  49. package/ext/descriptor/index.d.ts +0 -1
  50. package/ext/descriptor/index.js +1052 -1049
  51. package/ext/descriptor/test.js +54 -54
  52. package/google/LICENSE +27 -27
  53. package/google/README.md +1 -1
  54. package/google/api/annotations.proto +10 -10
  55. package/google/protobuf/descriptor.proto +286 -286
  56. package/google/protobuf/source_context.proto +7 -7
  57. package/index.d.ts +3 -1
  58. package/index.js +4 -4
  59. package/light.d.ts +2 -2
  60. package/light.js +3 -3
  61. package/minimal.d.ts +2 -2
  62. package/minimal.js +4 -4
  63. package/package-lock.json +5810 -3344
  64. package/package.json +24 -30
  65. package/scripts/changelog.js +150 -150
  66. package/scripts/postinstall.js +35 -35
  67. package/src/common.js +399 -399
  68. package/src/converter.js +293 -287
  69. package/src/decoder.js +106 -106
  70. package/src/encoder.js +99 -99
  71. package/src/enum.js +181 -181
  72. package/src/field.js +371 -370
  73. package/src/index-light.js +104 -104
  74. package/src/index-minimal.js +36 -36
  75. package/src/index.js +12 -12
  76. package/src/mapfield.js +126 -126
  77. package/src/message.js +138 -138
  78. package/src/method.js +151 -151
  79. package/src/namespace.js +433 -431
  80. package/src/object.js +200 -199
  81. package/src/oneof.js +203 -203
  82. package/src/parse.js +758 -757
  83. package/src/reader.js +405 -407
  84. package/src/reader_buffer.js +44 -44
  85. package/src/root.js +351 -350
  86. package/src/roots.js +18 -18
  87. package/src/rpc/service.js +142 -142
  88. package/src/rpc.js +36 -36
  89. package/src/service.js +167 -167
  90. package/src/tokenize.js +397 -397
  91. package/src/type.js +589 -589
  92. package/src/types.js +196 -196
  93. package/src/typescript.jsdoc +15 -15
  94. package/src/util/longbits.js +200 -200
  95. package/src/util/minimal.js +414 -405
  96. package/src/util.js +178 -178
  97. package/src/verifier.js +176 -176
  98. package/src/wrappers.js +83 -83
  99. package/src/writer.js +459 -459
  100. package/src/writer_buffer.js +81 -81
  101. package/tsconfig.json +6 -6
  102. package/google/protobuf/field_mask.json +0 -21
  103. package/google/protobuf/field_mask.proto +0 -7
package/cli/util.js CHANGED
@@ -1,183 +1,183 @@
1
- "use strict";
2
- var fs = require("fs"),
3
- path = require("path"),
4
- child_process = require("child_process");
5
-
6
- var semver;
7
-
8
- try {
9
- // installed as a peer dependency
10
- require.resolve("protobufjs");
11
- exports.pathToProtobufJs = "protobufjs";
12
- } catch (e) {
13
- // local development, i.e. forked from github
14
- exports.pathToProtobufJs = "..";
15
- }
16
-
17
- var protobuf = require(exports.pathToProtobufJs);
18
-
19
- function basenameCompare(a, b) {
20
- var aa = String(a).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g),
21
- bb = String(b).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g);
22
- for (var i = 0, k = Math.min(aa.length, bb.length); i < k; i++) {
23
- var x = parseFloat(aa[i]) || aa[i].toLowerCase(),
24
- y = parseFloat(bb[i]) || bb[i].toLowerCase();
25
- if (x < y)
26
- return -1;
27
- if (x > y)
28
- return 1;
29
- }
30
- return a.length < b.length ? -1 : 0;
31
- }
32
-
33
- exports.requireAll = function requireAll(dirname) {
34
- dirname = path.join(__dirname, dirname);
35
- var files = fs.readdirSync(dirname).sort(basenameCompare),
36
- all = {};
37
- files.forEach(function(file) {
38
- var basename = path.basename(file, ".js"),
39
- extname = path.extname(file);
40
- if (extname === ".js")
41
- all[basename] = require(path.join(dirname, file));
42
- });
43
- return all;
44
- };
45
-
46
- exports.traverse = function traverse(current, fn) {
47
- fn(current);
48
- if (current.fieldsArray)
49
- current.fieldsArray.forEach(function(field) {
50
- traverse(field, fn);
51
- });
52
- if (current.oneofsArray)
53
- current.oneofsArray.forEach(function(oneof) {
54
- traverse(oneof, fn);
55
- });
56
- if (current.methodsArray)
57
- current.methodsArray.forEach(function(method) {
58
- traverse(method, fn);
59
- });
60
- if (current.nestedArray)
61
- current.nestedArray.forEach(function(nested) {
62
- traverse(nested, fn);
63
- });
64
- };
65
-
66
- exports.traverseResolved = function traverseResolved(current, fn) {
67
- fn(current);
68
- if (current.resolvedType)
69
- traverseResolved(current.resolvedType, fn);
70
- if (current.resolvedKeyType)
71
- traverseResolved(current.resolvedKeyType, fn);
72
- if (current.resolvedRequestType)
73
- traverseResolved(current.resolvedRequestType, fn);
74
- if (current.resolvedResponseType)
75
- traverseResolved(current.resolvedResponseType, fn);
76
- };
77
-
78
- exports.inspect = function inspect(object, indent) {
79
- if (!object)
80
- return "";
81
- var chalk = require("chalk");
82
- var sb = [];
83
- if (!indent)
84
- indent = "";
85
- var ind = indent ? indent.substring(0, indent.length - 2) + "└ " : "";
86
- sb.push(
87
- ind + chalk.bold(object.toString()) + (object.visible ? " (visible)" : ""),
88
- indent + chalk.gray("parent: ") + object.parent
89
- );
90
- if (object instanceof protobuf.Field) {
91
- if (object.extend !== undefined)
92
- sb.push(indent + chalk.gray("extend: ") + object.extend);
93
- if (object.partOf)
94
- sb.push(indent + chalk.gray("oneof : ") + object.oneof);
95
- }
96
- sb.push("");
97
- if (object.fieldsArray)
98
- object.fieldsArray.forEach(function(field) {
99
- sb.push(inspect(field, indent + " "));
100
- });
101
- if (object.oneofsArray)
102
- object.oneofsArray.forEach(function(oneof) {
103
- sb.push(inspect(oneof, indent + " "));
104
- });
105
- if (object.methodsArray)
106
- object.methodsArray.forEach(function(service) {
107
- sb.push(inspect(service, indent + " "));
108
- });
109
- if (object.nestedArray)
110
- object.nestedArray.forEach(function(nested) {
111
- sb.push(inspect(nested, indent + " "));
112
- });
113
- return sb.join("\n");
114
- };
115
-
116
- function modExists(name, version) {
117
- for (var i = 0; i < module.paths.length; ++i) {
118
- try {
119
- var pkg = JSON.parse(fs.readFileSync(path.join(module.paths[i], name, "package.json")));
120
- return semver
121
- ? semver.satisfies(pkg.version, version)
122
- : parseInt(pkg.version, 10) === parseInt(version.replace(/^[\^~]/, ""), 10); // used for semver only
123
- } catch (e) {/**/}
124
- }
125
- return false;
126
- }
127
-
128
- function modInstall(install) {
129
- child_process.execSync("npm --silent install " + (typeof install === "string" ? install : install.join(" ")), {
130
- cwd: __dirname,
131
- stdio: "ignore"
132
- });
133
- }
134
-
135
- exports.setup = function() {
136
- var pkg = require(path.join(__dirname, "..", "package.json"));
137
- var version = pkg.dependencies["semver"] || pkg.devDependencies["semver"];
138
- if (!modExists("semver", version)) {
139
- process.stderr.write("installing semver@" + version + "\n");
140
- modInstall("semver@" + version);
141
- }
142
- semver = require("semver"); // used from now on for version comparison
143
- var install = [];
144
- pkg.cliDependencies.forEach(function(name) {
145
- if (name === "semver")
146
- return;
147
- version = pkg.dependencies[name] || pkg.devDependencies[name];
148
- if (!modExists(name, version)) {
149
- process.stderr.write("installing " + name + "@" + version + "\n");
150
- install.push(name + "@" + version);
151
- }
152
- });
153
- require("../scripts/postinstall"); // emit postinstall warning, if any
154
- if (!install.length)
155
- return;
156
- modInstall(install);
157
- };
158
-
159
- exports.wrap = function(OUTPUT, options) {
160
- var name = options.wrap || "default";
161
- var wrap;
162
- try {
163
- // try built-in wrappers first
164
- wrap = fs.readFileSync(path.join(__dirname, "wrappers", name + ".js")).toString("utf8");
165
- } catch (e) {
166
- // otherwise fetch the custom one
167
- wrap = fs.readFileSync(path.resolve(process.cwd(), name)).toString("utf8");
168
- }
169
- wrap = wrap.replace(/\$DEPENDENCY/g, JSON.stringify(options.dependency || "protobufjs"));
170
- wrap = wrap.replace(/( *)\$OUTPUT;/, function($0, $1) {
171
- return $1.length ? OUTPUT.replace(/^/mg, $1) : OUTPUT;
172
- });
173
- if (options.lint !== "")
174
- wrap = "/*" + options.lint + "*/\n" + wrap;
175
- return wrap.replace(/\r?\n/g, "\n");
176
- };
177
-
178
- exports.pad = function(str, len, l) {
179
- while (str.length < len)
180
- str = l ? str + " " : " " + str;
181
- return str;
182
- };
183
-
1
+ "use strict";
2
+ var fs = require("fs"),
3
+ path = require("path"),
4
+ child_process = require("child_process");
5
+
6
+ var semver;
7
+
8
+ try {
9
+ // installed as a peer dependency
10
+ require.resolve("protobufjs");
11
+ exports.pathToProtobufJs = "protobufjs";
12
+ } catch (e) {
13
+ // local development, i.e. forked from github
14
+ exports.pathToProtobufJs = "..";
15
+ }
16
+
17
+ var protobuf = require(exports.pathToProtobufJs);
18
+
19
+ function basenameCompare(a, b) {
20
+ var aa = String(a).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g),
21
+ bb = String(b).replace(/\.\w+$/, "").split(/(-?\d*\.?\d+)/g);
22
+ for (var i = 0, k = Math.min(aa.length, bb.length); i < k; i++) {
23
+ var x = parseFloat(aa[i]) || aa[i].toLowerCase(),
24
+ y = parseFloat(bb[i]) || bb[i].toLowerCase();
25
+ if (x < y)
26
+ return -1;
27
+ if (x > y)
28
+ return 1;
29
+ }
30
+ return a.length < b.length ? -1 : 0;
31
+ }
32
+
33
+ exports.requireAll = function requireAll(dirname) {
34
+ dirname = path.join(__dirname, dirname);
35
+ var files = fs.readdirSync(dirname).sort(basenameCompare),
36
+ all = {};
37
+ files.forEach(function(file) {
38
+ var basename = path.basename(file, ".js"),
39
+ extname = path.extname(file);
40
+ if (extname === ".js")
41
+ all[basename] = require(path.join(dirname, file));
42
+ });
43
+ return all;
44
+ };
45
+
46
+ exports.traverse = function traverse(current, fn) {
47
+ fn(current);
48
+ if (current.fieldsArray)
49
+ current.fieldsArray.forEach(function(field) {
50
+ traverse(field, fn);
51
+ });
52
+ if (current.oneofsArray)
53
+ current.oneofsArray.forEach(function(oneof) {
54
+ traverse(oneof, fn);
55
+ });
56
+ if (current.methodsArray)
57
+ current.methodsArray.forEach(function(method) {
58
+ traverse(method, fn);
59
+ });
60
+ if (current.nestedArray)
61
+ current.nestedArray.forEach(function(nested) {
62
+ traverse(nested, fn);
63
+ });
64
+ };
65
+
66
+ exports.traverseResolved = function traverseResolved(current, fn) {
67
+ fn(current);
68
+ if (current.resolvedType)
69
+ traverseResolved(current.resolvedType, fn);
70
+ if (current.resolvedKeyType)
71
+ traverseResolved(current.resolvedKeyType, fn);
72
+ if (current.resolvedRequestType)
73
+ traverseResolved(current.resolvedRequestType, fn);
74
+ if (current.resolvedResponseType)
75
+ traverseResolved(current.resolvedResponseType, fn);
76
+ };
77
+
78
+ exports.inspect = function inspect(object, indent) {
79
+ if (!object)
80
+ return "";
81
+ var chalk = require("chalk");
82
+ var sb = [];
83
+ if (!indent)
84
+ indent = "";
85
+ var ind = indent ? indent.substring(0, indent.length - 2) + "└ " : "";
86
+ sb.push(
87
+ ind + chalk.bold(object.toString()) + (object.visible ? " (visible)" : ""),
88
+ indent + chalk.gray("parent: ") + object.parent
89
+ );
90
+ if (object instanceof protobuf.Field) {
91
+ if (object.extend !== undefined)
92
+ sb.push(indent + chalk.gray("extend: ") + object.extend);
93
+ if (object.partOf)
94
+ sb.push(indent + chalk.gray("oneof : ") + object.oneof);
95
+ }
96
+ sb.push("");
97
+ if (object.fieldsArray)
98
+ object.fieldsArray.forEach(function(field) {
99
+ sb.push(inspect(field, indent + " "));
100
+ });
101
+ if (object.oneofsArray)
102
+ object.oneofsArray.forEach(function(oneof) {
103
+ sb.push(inspect(oneof, indent + " "));
104
+ });
105
+ if (object.methodsArray)
106
+ object.methodsArray.forEach(function(service) {
107
+ sb.push(inspect(service, indent + " "));
108
+ });
109
+ if (object.nestedArray)
110
+ object.nestedArray.forEach(function(nested) {
111
+ sb.push(inspect(nested, indent + " "));
112
+ });
113
+ return sb.join("\n");
114
+ };
115
+
116
+ function modExists(name, version) {
117
+ for (var i = 0; i < module.paths.length; ++i) {
118
+ try {
119
+ var pkg = JSON.parse(fs.readFileSync(path.join(module.paths[i], name, "package.json")));
120
+ return semver
121
+ ? semver.satisfies(pkg.version, version)
122
+ : parseInt(pkg.version, 10) === parseInt(version.replace(/^[\^~]/, ""), 10); // used for semver only
123
+ } catch (e) {/**/}
124
+ }
125
+ return false;
126
+ }
127
+
128
+ function modInstall(install) {
129
+ child_process.execSync("npm --silent install " + (typeof install === "string" ? install : install.join(" ")), {
130
+ cwd: __dirname,
131
+ stdio: "ignore"
132
+ });
133
+ }
134
+
135
+ exports.setup = function() {
136
+ var pkg = require(path.join(__dirname, "..", "package.json"));
137
+ var version = pkg.dependencies["semver"] || pkg.devDependencies["semver"];
138
+ if (!modExists("semver", version)) {
139
+ process.stderr.write("installing semver@" + version + "\n");
140
+ modInstall("semver@" + version);
141
+ }
142
+ semver = require("semver"); // used from now on for version comparison
143
+ var install = [];
144
+ pkg.cliDependencies.forEach(function(name) {
145
+ if (name === "semver")
146
+ return;
147
+ version = pkg.dependencies[name] || pkg.devDependencies[name];
148
+ if (!modExists(name, version)) {
149
+ process.stderr.write("installing " + name + "@" + version + "\n");
150
+ install.push(name + "@" + version);
151
+ }
152
+ });
153
+ require("../scripts/postinstall"); // emit postinstall warning, if any
154
+ if (!install.length)
155
+ return;
156
+ modInstall(install);
157
+ };
158
+
159
+ exports.wrap = function(OUTPUT, options) {
160
+ var name = options.wrap || "default";
161
+ var wrap;
162
+ try {
163
+ // try built-in wrappers first
164
+ wrap = fs.readFileSync(path.join(__dirname, "wrappers", name + ".js")).toString("utf8");
165
+ } catch (e) {
166
+ // otherwise fetch the custom one
167
+ wrap = fs.readFileSync(path.resolve(process.cwd(), name)).toString("utf8");
168
+ }
169
+ wrap = wrap.replace(/\$DEPENDENCY/g, JSON.stringify(options.dependency || "protobufjs"));
170
+ wrap = wrap.replace(/( *)\$OUTPUT;/, function($0, $1) {
171
+ return $1.length ? OUTPUT.replace(/^/mg, $1) : OUTPUT;
172
+ });
173
+ if (options.lint !== "")
174
+ wrap = "/*" + options.lint + "*/\n" + wrap;
175
+ return wrap.replace(/\r?\n/g, "\n");
176
+ };
177
+
178
+ exports.pad = function(str, len, l) {
179
+ while (str.length < len)
180
+ str = l ? str + " " : " " + str;
181
+ return str;
182
+ };
183
+
@@ -1,7 +1,7 @@
1
- define([$DEPENDENCY], function($protobuf) {
2
- "use strict";
3
-
4
- $OUTPUT;
5
-
6
- return $root;
7
- });
1
+ define([$DEPENDENCY], function($protobuf) {
2
+ "use strict";
3
+
4
+ $OUTPUT;
5
+
6
+ return $root;
7
+ });
@@ -1,7 +1,7 @@
1
- (function($protobuf) {
2
- "use strict";
3
-
4
- $OUTPUT;
5
-
6
- return $root;
7
- })(protobuf);
1
+ (function($protobuf) {
2
+ "use strict";
3
+
4
+ $OUTPUT;
5
+
6
+ return $root;
7
+ })(protobuf);
@@ -1,7 +1,7 @@
1
- "use strict";
2
-
3
- var $protobuf = require($DEPENDENCY);
4
-
5
- $OUTPUT;
6
-
7
- module.exports = $root;
1
+ "use strict";
2
+
3
+ var $protobuf = require($DEPENDENCY);
4
+
5
+ $OUTPUT;
6
+
7
+ module.exports = $root;
@@ -1,15 +1,15 @@
1
- (function(global, factory) { /* global define, require, module */
2
-
3
- /* AMD */ if (typeof define === 'function' && define.amd)
4
- define([$DEPENDENCY], factory);
5
-
6
- /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
7
- module.exports = factory(require($DEPENDENCY));
8
-
9
- })(this, function($protobuf) {
10
- "use strict";
11
-
12
- $OUTPUT;
13
-
14
- return $root;
15
- });
1
+ (function(global, factory) { /* global define, require, module */
2
+
3
+ /* AMD */ if (typeof define === 'function' && define.amd)
4
+ define([$DEPENDENCY], factory);
5
+
6
+ /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
7
+ module.exports = factory(require($DEPENDENCY));
8
+
9
+ })(this, function($protobuf) {
10
+ "use strict";
11
+
12
+ $OUTPUT;
13
+
14
+ return $root;
15
+ });
@@ -1,5 +1,5 @@
1
- import * as $protobuf from $DEPENDENCY;
2
-
3
- $OUTPUT;
4
-
5
- export { $root as default };
1
+ import * as $protobuf from $DEPENDENCY;
2
+
3
+ $OUTPUT;
4
+
5
+ export { $root as default };
package/dist/README.md CHANGED
@@ -1,31 +1,31 @@
1
- This folder contains prebuilt browser versions of the full library. When sending pull requests, it is not required to update these.
2
-
3
- Prebuilt files are in source control to enable pain-free frontend respectively CDN usage:
4
-
5
- CDN usage
6
- ---------
7
-
8
- Development:
9
- ```
10
- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.js"></script>
11
- ```
12
-
13
- Production:
14
- ```
15
- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.min.js"></script>
16
- ```
17
-
18
- **NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon.
19
-
20
- Frontend usage
21
- --------------
22
-
23
- Development:
24
- ```
25
- <script src="node_modules/protobufjs/dist/protobuf.js"></script>
26
- ```
27
-
28
- Production:
29
- ```
30
- <script src="node_modules/protobufjs/dist/protobuf.min.js"></script>
31
- ```
1
+ This folder contains prebuilt browser versions of the full library. When sending pull requests, it is not required to update these.
2
+
3
+ Prebuilt files are in source control to enable pain-free frontend respectively CDN usage:
4
+
5
+ CDN usage
6
+ ---------
7
+
8
+ Development:
9
+ ```
10
+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.js"></script>
11
+ ```
12
+
13
+ Production:
14
+ ```
15
+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/protobuf.min.js"></script>
16
+ ```
17
+
18
+ **NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon.
19
+
20
+ Frontend usage
21
+ --------------
22
+
23
+ Development:
24
+ ```
25
+ <script src="node_modules/protobufjs/dist/protobuf.js"></script>
26
+ ```
27
+
28
+ Production:
29
+ ```
30
+ <script src="node_modules/protobufjs/dist/protobuf.min.js"></script>
31
+ ```
@@ -1,31 +1,31 @@
1
- This folder contains prebuilt browser versions of the light library suitable for use with reflection, static code and JSON descriptors / modules. When sending pull requests, it is not required to update these.
2
-
3
- Prebuilt files are in source control to enable pain-free frontend respectively CDN usage:
4
-
5
- CDN usage
6
- ---------
7
-
8
- Development:
9
- ```
10
- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/light/protobuf.js"></script>
11
- ```
12
-
13
- Production:
14
- ```
15
- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/light/protobuf.min.js"></script>
16
- ```
17
-
18
- **NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon.
19
-
20
- Frontend usage
21
- --------------
22
-
23
- Development:
24
- ```
25
- <script src="node_modules/protobufjs/dist/light/protobuf.js"></script>
26
- ```
27
-
28
- Production:
29
- ```
30
- <script src="node_modules/protobufjs/dist/light/protobuf.min.js"></script>
31
- ```
1
+ This folder contains prebuilt browser versions of the light library suitable for use with reflection, static code and JSON descriptors / modules. When sending pull requests, it is not required to update these.
2
+
3
+ Prebuilt files are in source control to enable pain-free frontend respectively CDN usage:
4
+
5
+ CDN usage
6
+ ---------
7
+
8
+ Development:
9
+ ```
10
+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/light/protobuf.js"></script>
11
+ ```
12
+
13
+ Production:
14
+ ```
15
+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.X.X/dist/light/protobuf.min.js"></script>
16
+ ```
17
+
18
+ **NOTE:** Remember to replace the version tag with the exact [release](https://github.com/dcodeIO/protobuf.js/tags) your project depends upon.
19
+
20
+ Frontend usage
21
+ --------------
22
+
23
+ Development:
24
+ ```
25
+ <script src="node_modules/protobufjs/dist/light/protobuf.js"></script>
26
+ ```
27
+
28
+ Production:
29
+ ```
30
+ <script src="node_modules/protobufjs/dist/light/protobuf.min.js"></script>
31
+ ```