
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
https://github.com/holepunchto/librpc ABI compatible RPC for Bare.
npm i bare-rpc
import RPC from 'bare-rpc'
// On one end
const rpc = new RPC(stream, (req) => {
if (req.command === 42) {
console.log(req.data.toString()) // ping
req.reply('pong')
}
})
// On the other end
const req = rpc.request(42)
req.send('ping')
const replyBuffer = await req.reply()
console.log(replyBuffer.toString()) // pong
RPCconst rpc = new RPC(stream[, onrequest])Create an RPC instance using a duplex stream. onrequest is an optional callback run when a remote request is received. This is where processing and responding to an RPC request happens. onrequest receives a RPCIncomingRequest as an argument, for example:
const rpc = new RPC(stream, (req) => {
if (req.command === 42) {
req.reply('pong')
}
})
See RPCIncomingRequest for properties and methods for processing the request.
onrequest can also be a RPCCommandRouter.
const req = rpc.request(command)Create a request for command. command is a unique number that should be used to differentiate different requests on the remote end. Returns a RPCOutgoingRequest.
RPCOutgoingRequestreq.commandThe command that the request was created with. A command is a unique number.
req.sentA boolean for whether the request has been sent.
req.receivedA boolean for whether the request has received a reply.
req.send([data[, encoding]])Send the request with the provided data. data can be a buffer or a string which will be encoded using encoding.
.send() can only be called once per request.
const data = await req.reply([encoding])Await the reply from the remote end to the request. encoding can be defined for decoding the response data buffer back into a string.
const stream = req.createRequestStream([options])Create a Writable stream for sending data with the request.
const stream = req.createResponseStream([options])Create a Readable stream for receiving data in reply to the request.
RPCIncomingRequestreq.commandThe command that the request was sent as. A command is a unique number.
req.dataThe data buffer sent with the request.
req.sentA boolean for whether a reply has been sent.
req.receivedA boolean for whether the request has been received as a stream. See req.createRequestStream() for receiving requests as a stream.
req.reply([data, [encoding]])Reply to the request with the provided data. data can be a buffer or a string which will be encoded using encoding.
const stream = req.createRequestStream([options])Create a Readable stream for receiving data from the request.
const stream = req.createResponseStream([options])Create a Writable stream for sending data in reply to the request.
RPCCommandRouterAn alternative way to define commands and handlers for receiving them.
const router = new RPC.CommandRouter()Create a new command router. This router can then be used when creating an rpc. For example:
const router = new RPC.CommandRouter()
router.respond(42, (req, data) => {
console.log(data.toString()) // ping
return Buffer.from('pong')
})
const rpc = new RPC(stream, router)
const req = rpc.request(42)
req.send('ping')
router.respond(command[, options], async (req, data) => {})Define a command and the handler for it. The callback for a command receives both the request (req) and the data buffer and can return a value to respond. If the request is responded to in the callback, the return value is ignored.
Options include:
options = {
// Encoding for incoming request
requestEncoding: c.raw,
// Encoding for outgoing response
responseEncoding: c.raw
}
Apache-2.0
FAQs
librpc ABI compatible RPC for Bare
We found that bare-rpc 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.
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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.