This article will explain how to use Node.js bindings for REST API.
This module is still under active development. Some REST API bindings have not been implemented yet.
Basic knowledge of Treasure Data, including the Toolbelt.
A table with some data. An example is provided in the Getting Started guide.
Basic knowledge of our query language.
This client module requires an API key to access Treasure Data REST API. Get it from Users in the TD Console in advance.
The module is published in NPM. Add the following line to your packages.json.
The source code is available at GitHub.
List Databases and Tables
The example below prints out all your tables to the console.
The example below issues a query from Node.js. After issuing the query, a job_id field is printed out. This can be used to query the results.
List and Get the Status of Jobs
The example below lists and gets the status of jobs.
For more detail, check full API reference of node client package.