You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Luke Childs f3d1e3b842 Fix error in usage example 8 years ago
src Set default cache ttl to 5 hours 8 years ago
test Drop standard in favour of xo 8 years ago
.gitignore Add .gitignore 9 years ago
.travis.yml Integrate with Travis and Coveralls 8 years ago
LICENSE Add LICENSE file 8 years ago
README.md Fix error in usage example 8 years ago
package.json Update description 8 years ago

README.md

onionoo-node-client

Node.js client library for the Tor Onionoo API

Build Status Coverage Status

Promise based client library for the Tor Onionoo API. Includes DB agnostic caching.

Install

npm install --save onionoo

Usage

const Onionoo = require('onionoo');
const onionoo = new Onionoo();

// Get top 10 relays
const query = {
  limit: 10,
  running: true,
  order: '-consensus_weight'
};

onionoo.summary(query).then(response => {
    console.log(response.body)
    // {
    //   version:'3.1',
    //   relays_published:'2016-12-23 09:00:00',
    //   relays:[
    //     [Object],
    //     [Object],
    //     [Object],
    //     [Object],
    //     [Object],
    //     [Object],
    //     [Object],
    //     [Object],
    //     [Object],
    //     [Object]
    //   ],
    //   bridges_published:'2016-12-23 07:41:03',
    //   bridges:[]
    // }
});

License

MIT © Luke Childs