Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
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.
grpc-create-metadata
Advanced tools
Simple Node.js helper utility for creating gRPC metadata
Example (Installation)
npm install grpc-create-metadata
Example (Usage)
const grpc = require('grpc')
const create = require('grpc-create-metadata')
const meta = create({
name: 'Bob',
age: 20,
active: true
});
console.log(meta instanceof grpc.Metadata) // true
console.dir(meta.getMap()) // { foo: 'bar', age: '12', prop: 'true' }
Metadata
⏏Utility helper function to create Metadata
object from plain Javascript object
This strictly just calls Metadata.add
with the key / value map of objects.
If the value is a Buffer
it's passed as is.
If the value is a Sting
it's passed as is.
Else if the value defined and not a string we simply call toString()
.
Note that Metadata
only accept string or buffer values.
Kind: Exported function
Returns: Metadata
- An instance of Metadata
, or undefined
if input is not an object
Param | Type | Description |
---|---|---|
metadata | Object | Plain javascript object to tranform into Metadata If an instance of Metadata is passed in it is simply returned |
options | Object | options |
options.addEmpty | Boolean | whether to add empty strings. Default: false |
FAQs
A simple Node.js helper utility for creating gRPC metadata
The npm package grpc-create-metadata receives a total of 17,852 weekly downloads. As such, grpc-create-metadata popularity was classified as popular.
We found that grpc-create-metadata 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
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.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.