3.1.0 • Published 4 years ago

@tomsd/sharepoint v3.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

@tomsd/sharepoint

Installation

npm install @tomsd/sharepoint

Usage

You can script in your HTML page placed on your SharePoint site.

import SharePoint from "@tomsd/sharepoint";
const siteurl = "https://[sharepoint.yoursite.com]/";
const sp = new SharePoint(siteurl);
sp.getLists().then(function(list){
  console.log(lists);
});
const listid = "xxxx-xxxx-xxxx-xxxx";
sp.getList(listid).then(function(list){
  console.log(list);
});
let spquery = sp.newquery().add("Eq","ID","Number",1).addviewfield("Title").setrowlimit(1);
sp.getListItems(listid, spquery).then(function(items){
  console.log(items);
});
// insert item
sp.upsertListItem(listid, {Title:"test"}).then(function(){
  console.log("inserted");
});
// update item with ID
sp.upsertListItem(listid, {ID:"1",Title:"updated title"}).then(function(){
  console.log("updated");
});
sp.removeListItem(listid, {ID:"1"}).then(function(){
  console.log("removed");
});
3.1.0

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago