alejandroechev / node-panlex

node.js client for PanLex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This module provides convenience methods to access the PanLex API.

var panlex = require('panlex');

// set User-agent header with app name and version
panlex.setUserAgent('My application', '0.0.3');

// turn off built-in rate limiting (careful!)
panlex.limit = false;

Callback style:

// do a single request
panlex.query('/lv', {}, function (err, data) { ... });

// loop until all results are received
panlex.queryAll('/lv', {}, function (err, data) { ... });

Stream style:

// do a single request
panlex.queryStream('/lv', {})
  .on('data', function (lv) { ... }) // single lv object
  .on('error', function (err) { ... })
  .on('end', function () { ... });

// loop until all results are received
panlex.queryStreamAll('/lv', {})
  .on('data', function (lv) { ... }) // single lv object
  .on('error', function (err) { ... })
  .on('end', function () { ... });

About

node.js client for PanLex

License:MIT License


Languages

Language:JavaScript 100.0%