
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@alexmerced/simplerpc-server
Advanced tools
npm install @alexmerced/simplerpc-server
The SimpleRPC framework is a framework for creating very simple lightweight RPC APIs for use with any backend or frontend framework with a redux/useReducer like API.
Actions take the signature of
(payload: Object, context: Object) => response:Any
The client function then can be called like so:
rpcDispatch({type: "actionName", payload: {arg1: 1, arg 2: "hello"}})
First we create an handler
const createHandler = require("@alexmerced/simplerpc-server")
// server actions
const actions = {
getList: (payload, context) => {
console.log(context)
return [1,2,3,4,5]
}
addToList: (payload, context) => {
console.log(context)
return [1,2,3,4,5, payload.num]
}
}
// context - other data, each action should always have available
const context = {
user: "Mr. Jones"
}
// create the handler
const handler = createHandler({actions, context})
module.exports = handler
The route must be used for a post route, the endpoint url can be anything, we recommend /rpc.
expressjs
app.post("/rpc", (req, res) => {
const result = handler(req.body)
res.json(result)
})
fastifyjs
fastify.post('/rpc', async (request, reply) => {
const result = handler(request.body)
return result
})
koajs (using koa router & koa-bodyparser)
router.get('/rpc', (ctx, next) => {
const result = handler(ctx.request.body)
return result
});
You can now call your actions by:
{
"type": "actionName",
"payload":{
"arg1": 1,
"arg2": "whatever"
}
}
FAQs
server library for simplerpc - RPC API framework
The npm package @alexmerced/simplerpc-server receives a total of 16 weekly downloads. As such, @alexmerced/simplerpc-server popularity was classified as not popular.
We found that @alexmerced/simplerpc-server 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.