Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
protobuf-preloader
Advanced tools
Webpack loader to translate .proto definitions to ProtoBuf.js modules
Webpack loader to translate protobuf definitions to ProtoBuf.js modules. Equivalent to running your definitions through the pbjs CLI.
This allows you to use the light or minimal ProtoBuf.js distributions without an explicit compile step in your build pipeline.
npm install --save-dev protobufjs-loader-webpack4
// webpack.config.js
module.exports = {
...
module: {
rules: [{
test: /\.proto$/,
use: {
loader: 'protobuf-preloader',
options: {
/* controls the "target" flag to pbjs - true for
* json-module, false for static-module.
* default: false
*/
json: true,
/* import paths provided to pbjs.
* default: webpack import paths (i.e. config.resolve.modules)
*/
paths: ['/path/to/definitions'],
/* additional command line arguments passed to
* pbjs, see https://github.com/dcodeIO/ProtoBuf.js/#pbjs-for-javascript
* for a list of what's available.
* default: []
*/
pbjsArgs: ['--no-encode']
}
}
}]
}
};
// myModule.js
/* replaces e.g.:
*
* const protobuf = require('protobufjs/light');
* const jsonDescriptor = require('json!my/compiled/protobuf.js');
* const Root = protobuf.Root.fromJSON(jsonDescriptor);
*/
const Root = require('my/protobuf.proto');
FAQs
Webpack loader to translate .proto definitions to ProtoBuf.js modules
We found that protobuf-preloader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.