
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
@grpc/grpc-js
Advanced tools
Node 12 is recommended. The exact set of compatible Node versions can be found in the engines field of the package.json file.
npm install @grpc/grpc-js
Documentation specifically for the @grpc/grpc-js package is currently not available. However, documentation is available for the grpc package, and the two packages contain mostly the same interface. There are a few notable differences, however, and these differences are noted in the "Migrating from grpc" section below.
If you need a feature from the grpc package that is not provided by the @grpc/grpc-js, please file a feature request with that information.
This library does not directly handle .proto files. To use .proto files with this library we recommend using the @grpc/proto-loader package.
grpc@grpc/grpc-js is almost a drop-in replacement for grpc, but you may need to make a few code changes to use it:
.proto files using grpc.load, that function is not available in this library. You should instead load your .proto files using @grpc/proto-loader and load the resulting package definition objects into @grpc/grpc-js using grpc.loadPackageDefinition.grpc-tools, you should instead generate your files using the generate_package_definition option in grpc-tools, then load the object exported by the generated file into @grpc/grpc-js using grpc.loadPackageDefinition.Server#bind to bind ports, you will need to use Server#bindAsync instead.grpc but not supported in @grpc/grpc-js, you may need to adjust your code to handle the different behavior. Refer to the list of supported options below.grpc and @grpc/grpc-js.Many channel arguments supported in grpc are not supported in @grpc/grpc-js. The channel arguments supported by @grpc/grpc-js are:
grpc.ssl_target_name_overridegrpc.primary_user_agentgrpc.secondary_user_agentgrpc.default_authoritygrpc.keepalive_time_msgrpc.keepalive_timeout_msgrpc.keepalive_permit_without_callsgrpc.service_configgrpc.max_concurrent_streamsgrpc.initial_reconnect_backoff_msgrpc.max_reconnect_backoff_msgrpc.use_local_subchannel_poolgrpc.max_send_message_lengthgrpc.max_receive_message_lengthgrpc.enable_http_proxygrpc.default_compression_algorithmgrpc.enable_channelzgrpc.dns_min_time_between_resolutions_msgrpc.enable_retriesgrpc.max_connection_age_msgrpc.max_connection_age_grace_msgrpc.max_connection_idle_msgrpc.per_rpc_retry_buffer_sizegrpc.retry_buffer_sizegrpc.service_config_disable_resolutiongrpc.client_idle_timeout_msgrpc-node.max_session_memorygrpc-node.tls_enable_tracegrpc-node.retry_max_attempts_limitgrpc-node.flow_control_windowchannelOverridechannelFactoryOverrideThe public API of this library follows semantic versioning, with some caveats:
Call is only exposed due to limitations of TypeScript. It should not be considered part of the public API.grpc library is likely an error and should not be considered part of the public API.grpc.experimental namespace contains APIs that have not stabilized. Any API in that namespace may break in any minor version update.The 'grpc' package is the original Node.js gRPC library, which relies on the C-based gRPC core library. It provides similar functionality to @grpc/grpc-js but requires native dependencies. The @grpc/grpc-js package was created as a pure JavaScript alternative, eliminating the need for native compilation and simplifying deployment, especially in serverless environments.
While 'protobufjs' is not a direct alternative to @grpc/grpc-js, it is a related package that provides tools for working with Protocol Buffers, which are an integral part of gRPC. It allows you to encode and decode Protocol Buffers messages but does not handle the gRPC networking layer.
Apache Thrift is another RPC framework that can be used as an alternative to gRPC. It supports multiple programming languages and has its own interface definition language (IDL). The 'thrift' package for Node.js allows you to build clients and servers using the Thrift protocol, which, like gRPC, is designed for efficient communication between services.
FAQs
gRPC Library for Node - pure JS implementation
The npm package @grpc/grpc-js receives a total of 28,351,615 weekly downloads. As such, @grpc/grpc-js popularity was classified as popular.
We found that @grpc/grpc-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.