Class: exports

exports(apikey, options)

Treasure Data REST API Client

Constructor

new exports(apikey, options)

Parameters:
Name Type Description
apikey string The API key available from user account.
options object Specify the endpoint of TreasureData api. options.host = 'api.treasuredata.com' options.protocol = 'http'
Version:
  • 0.3.0
Author:
  • jwyuan and lewuathe
License:
  • Apache-2.0
Source:
See:
Requires:
  • module:request
  • module:querystring
  • module:merge
Example
var TD = require('td');
 var client = new TD('TREASURE_DATA_API_KEY');

 var fnPrint = function(err, results) {
   console.log(results);
 };
 client.listDatabase(function(err, results) {
   for (var i = 0; i < results.databases.length; i++) {
     client.listTables(results.databases[i].name, fnPrint);
   }
 });

 

Requires

  • module:request
  • module:querystring
  • module:merge