Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including jisson-rpc with all npm packages installed. Try it out:

var jissonRpc = require("jisson-rpc")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jisson-rpc v0.0.2

JSON-RPC server object oriented


JissonRPC is a JSON-RPC 2.0 server as a middleware to use with Express.js.


  • Basic implementation of JSON-RPC 2.0 specification on server side
  • Works as a middleware with Express.js
  • Batch multi requests
  • Structure of request as object oriented controllers and actions
  • Give access to request and response into action methods


See Express example


  • 0.0.1 : Initial release


Just call npm install.

Running tests

Just run npm test.


Just add the jissonrpc server as a middleware in your express app. You can specify the folder where your services are located as a config object params :

app.use('/api', jissonrpc({services: 'the path'}))

Your services must be called with a simple alphanumerical name with just letters and numbers. Example : test.js.

Theses services must implement a class (function with prototype) which contains your API methods as methodnameMethod. Example : testMethod.

Example for the method user.get, you will have a file named user.js with this content :

var UserService = function(){};
UserService.prototype = {
    getMethod: function(params, callback/*(error, result)*//*, req, res*/)

module.exports = UserService;

For each of your methods, you'll have access to four parameters :

  • params : is the params object sent by the client
  • callback : is the callback to call when you finished your process. It take two params : first is an error object, second is a result object.
  • req : is the request object from the http server. You shouldn't have to use it, but you have it if needed
  • res : is the response object from the http server. Same advice as req, use it only if you have to send a very specific response.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free