Data Garage node tool
Nodejs tool for Data Garage usage.
Install
npm install dgr
Sample
Data
Usage
Public methods
dgr_obj.all(callback)
Getting all the data from resource.
var dgr= ;var dgr_obj= <data id>dgr_objall { iferr console else dgr_obj; dgr_obj }
-
Arguments
- callback : (function)
- error: return error message, if no error return
null
- result: return result should return a JSON
- error: return error message, if no error return
- callback : (function)
dgr_obj.custom(config, callback)
Getting customize data from resource.
var dgr= ;var dgr_obj= <data id>dgr_obj
- Arguments
-
configure : (object)
- limit: You can limit the data set you are pulling from remote, should be a number
- fields: Select the fields you want to get, should be a string seperate by comma (for example:
Format, Valuie, ...
) - skip: You could also skip the record you don't want( for example:
skip: 2
, that means the data will start from the 3) - selector : You can also select the data using greater, lesser, or equal ( for exmaple:
B Fmt=General
)
-
callback : (function)
- error: return error message, if no error return
null
- result: return result should return a JSON
- error: return error message, if no error return
-
After you fetch data from resource
Remind : You will have to use one of custom
or all
method before you use following methods.
dgr_obj.tableize(json)
see more details in https://github.com/DataGarage/node-json-table
tableize
method can convert your json to table easily.
dgr_obj.row(0, callback)
- return:
Object
- example:
example.row(0, function(err, result) {})
dgr_obj.col(0, callback) or dgr_obj.col(<column_name>, callback)
- return:
Array
- example:
example.col(0, function(err, result){})
- example2:
example.col('Format', function(err, result){})
License
MIT