node.js - Node js如何连接读取文件excel云(在线)?
问题描述
我有一个使用节点 js 的项目,我想从微软连接到一个 excel(云)在线文件。如何在线读取excel文件,监听文件更改事件。
请 !!!
我试过点分享!但不工作!`
var url = 'https://myproject.sharepoint.com/personal/name';
var username = "username@microsoft.com.";
var password = "*******";
app.get('/',(req,res,next) => {
console.log(req.connection.remoteAddress)
spauth.getAuth(url, {
username:username,
password:password
})
.then(function(options){
// Access Token will be available on the options.headers variable
var listTitler="OP Production Tracking Online Ver3.1";
var headers = options.headers;
headers['Accept'] = 'application/json;odata=verbose';
// Pull the SharePoint list items
requestprom.get({
url: url+"/_api/web/lists/getbytitle('"+listTitler+"')",
headers: headers,
json: true
}).then(function(listresponse){
var items = listresponse.d.Title;
var responseJSON = [];
// process
console.log(JSON.stringify(listresponse))
// response.end( JSON.stringify ( listresponse ));
});
});
`
解决方案
您可以使用Excel JavaScript API读取和跟踪文件中的任何更改。该文档为您提供了许多可用于使用 Excel 表格的方法。
推荐阅读
- python - 注册 Key_acute 事件在第一次按键时不起作用
- python - 有人知道模仿 TradingView 编辑器的 Python 脚本吗?
- reactjs - Firebase 和 React:CollectionReference.doc() 参数类型
- error-handling - 在 SAS Studio 中访问 SASHELP.ZIPCODE.DATA 的错误代码
- firebase - I/flutter (22027):MissingPluginException(在通道 plugins.flutter.io/cloud_firestore 上找不到方法 DocumentReference#setData 的实现)
- java - Spring MVC 在 WAR 和 JAR 文件中带有 jsp 文件
- php - 试图验证 JWT 签名 Tymon/jwt-auth laravel
- python - 使用 BeautifulSoup Python 进行 Web 抓取返回 None
- r - R:基于超过 1 个变量对记录进行分类
- python - 在 Python 中打印某些 JSON 数据