Skip to content

Commit

Permalink
Changed README to use Markdown and added install instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
justmoon committed Jul 1, 2011
1 parent de0c6c4 commit e2ab1c7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 30 deletions.
30 changes: 0 additions & 30 deletions README

This file was deleted.

43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# node-jsonrpc2

This is a JSON-RPC server and client library for node.js <http://nodejs.org/>,
the V8 based evented IO framework.

## Install

To install node-jsonrpc2 in the current directory, run:

npm install jsonrpc2

## Usage

Firing up an efficient JSON-RPC server becomes extremely simple:

``` javascript
var rpc = require('jsonrpc');

function add(first, second) {
return first + second;
}
rpc.expose('add', add);

rpc.listen(8000, 'localhost');
```

And creating a client to speak to that server is easy too:

``` javascript
var rpc = require('jsonrpc');
var sys = require('sys');

var client = rpc.getClient(8000, 'localhost');

client.call('add', [1, 2], function(result) {
sys.puts('1 + 2 = ' + result);
});
```

To learn more, see the examples directory, peruse test/jsonrpc-test.js, or
simply "Use The Source, Luke".

More documentation and development is on its way.

0 comments on commit e2ab1c7

Please sign in to comment.