Skip to content

Commit

Permalink
readme: document new apis
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Aug 9, 2012
1 parent 27a2b42 commit 494d481
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,33 @@ Route table bindings for node.js
## Usage

```javascript
require('netroute').getGateway(); // 192.168.1.1
// Get routes list
require('netroute').getInfo();
/*
Returns object:
{
"IPv4": [{
"destination": "0.0.0.0",
"gateway": "192.168.10.1",
"netmask": "124.0.5.4",
"mtu": 1500,
"rtt": 0,
"expire": 0,
"interface": "en1"
}, ...],
"IPv6": [{
...
}, ...]
}
Note: fields may differ on different platforms
(though gateway, destination, netmask and interface should be always
available).
*/


// Get default gateway
require('netroute').getGateway(/* optional interface */); // 192.168.1.1
```

### License
Expand Down

0 comments on commit 494d481

Please sign in to comment.