Single JavaScript API Client for Google Sheets and MS Excel APIs

栏目: IT技术 · 发布时间: 5年前

内容简介:JavaScript Library for Google Sheets/Microsoft Excel Online through sheet2api.The sheet2api JS library can be installed through npm.To get started you need to provide your sheet2api Spreadsheet API URL. You can find it on the

sheet2api JavaScript Client

JavaScript Library for Google Sheets/Microsoft Excel Online through sheet2api. https://sheet2api.com/

Installation

The sheet2api JS library can be installed through npm.

npm install sheet2api-js --save

Example Usage

To get started you need to provide your sheet2api Spreadsheet API URL. You can find it on the sheet2api Dashboard .

Try it out with the codepen https://codepen.io/sheet2api/pen/MWKZrqW

Importing the library

<!-- Server import -->
<script src="//sheet2api.com/v1/api.js"></script>
// Or, Require import
var Sheet2API = require('sheet2api-js');
// Or, ES6 import
import Sheet2API from 'sheet2api-js';

Read rows

<script src="//sheet2api.com/v1/api.js"></script>
<script>
var url = 'https://sheet2api.com/v1/FgI6zV8qT121/characters/';
var options = {};
Sheet2API.read(url, options).then(function(result){
  console.log(result);
}, function(error){
  console.log(error);
});
</script>

Read rows matching a search query

<script src="//sheet2api.com/v1/api.js"></script>
<script>
var url = 'https://sheet2api.com/v1/FgI6zV8qT121/characters/';
var options = {query: { 'Name': 'Bugs Bunny' }};
Sheet2API.read(url, options).then(function(result){
  console.log(result);
}, function(error){
  console.log(error);
});
</script>

Create new rows

<script src="//sheet2api.com/v1/api.js"></script>
<script>
var url = 'https://sheet2api.com/v1/FgI6zV8qT121/characters/';
var newRowData = { "Favourite Thing": "Carrots", "Name": "Bugs Bunny" };
var options = {};
Sheet2API.write(url, options, newRowData).then(function(result){
  console.log(result);
}, function(error){
  console.log(error);
});
</script>

Something missing you'd like to see? Please create an issue.


很遗憾的说,推酷将在这个月底关闭。人生海海,几度秋凉,感谢那些有你的时光。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

像程序员一样思考

像程序员一样思考

V. Anton Spraul / 徐波 / 人民邮电出版社 / 2013-6 / 49.00元

编程的真正挑战不是学习一种语言的语法,而是学习创造性地解决问题,从而构建美妙的应用。《像程序员一样思考》分析了程序员解决问题的方法,并且教授你其他图书所忽略的一种能力,即如何像程序员一样思考。全书分为8章。第1章通对几个经典的算法问题切入,概括了问题解决的基本技巧和步骤。第2章通过实际编写C++代码来解决几个简单的问题,从而让读者进一步体会到问题解决的思路和应用。第3到7章是书中的主体部分,分别探......一起来看看 《像程序员一样思考》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具