Comparing version 1.0.0 to 1.1.0
27
index.js
@@ -63,4 +63,31 @@ 'use strict'; | ||
} | ||
get(params) { | ||
let _this = this; | ||
return new Promise(function(resolve, reject) { | ||
_this.getData(params, function(results){ | ||
resolve(results); | ||
}); | ||
}); | ||
} | ||
getAll() { | ||
let _this = this; | ||
return new Promise(function(resolve, reject) { | ||
_this.getAllData(function(results){ | ||
resolve(results); | ||
}); | ||
}); | ||
} | ||
add(params) { | ||
let _this = this; | ||
return new Promise(function(resolve, reject) { | ||
_this.addRow(params, function(results){ | ||
resolve(results); | ||
}); | ||
}); | ||
} | ||
} | ||
module.exports = Sheetsu; |
{ | ||
"name": "sheetsu", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Node JS client for Sheetsu", | ||
@@ -14,3 +14,8 @@ "main": "index.js", | ||
"keywords": [ | ||
"sheetsu" | ||
"sheetsu", | ||
"sheet api", | ||
"google sheet", | ||
"sheet", | ||
"spreadsheet", | ||
"api" | ||
], | ||
@@ -24,4 +29,7 @@ "author": "Debopam Sengupta", | ||
"dependencies": { | ||
"bluebird": "^3.0.6", | ||
"co": "^4.6.0", | ||
"lodash": "^3.10.1", | ||
"request": "^2.67.0" | ||
} | ||
} |
@@ -1,10 +0,13 @@ | ||
# node-sheetsu | ||
# node-sheetsu [![Downloads](https://img.shields.io/npm/dm/sheetsu.svg)](https://www.npmjs.com/package/sheetsu) | ||
Node JS module for using Sheetsu | ||
## What's new (v1.1.0) | ||
* Supports Promises now. Use the ```get``` , ```getAll``` and ```add``` methods to use yield-ables. | ||
## Getting Started | ||
* Install the module ```npm install sheetsu``` | ||
* Example usage : | ||
``` | ||
```javascript | ||
var Sheetsu = require('sheetsu'); | ||
var co = require('co'); | ||
var test_url = 'YOUR_SHEETSU_API'; | ||
@@ -14,7 +17,9 @@ | ||
dev.getData({column_name:'...'}, function(response) { | ||
console.log(response.data); | ||
}); | ||
dev.addRow({...}, function(response) { | ||
console.log(response); | ||
}); | ||
co(function* () { | ||
let result = yield dev.getAll(); | ||
console.log(result); | ||
}) | ||
@@ -35,1 +40,9 @@ ``` | ||
* ```callback``` : function to be executed after the method | ||
### getAll () | ||
### get (params) | ||
* ```params``` : Should include the field ```column_name``` to get data of the particular column | ||
### add (params) | ||
* ```params``` : Should include the row of information to add to the spreadsheet |
5063
84
47
4
+ Addedbluebird@^3.0.6
+ Addedco@^4.6.0
+ Addedlodash@^3.10.1
+ Addedbluebird@3.7.2(transitive)
+ Addedco@4.6.0(transitive)
+ Addedlodash@3.10.1(transitive)