A pure JavaScript library for SharePoint REST web services (v1.9.0, last release 2021). Provides promise-based CRUD for lists, files, folders, users, and site properties across SharePoint 2013, 2016, and Online. Unlike CSOM, it has no dependency on SharePoint client DLLs, enabling lightweight SPAs and add-ins. OData v3 compatible.
npm install sprestlibNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows default import, fetching list items with CAML query, and arbitrary REST call.
Always pass an options object: sprLib.rest({ url: '...' })Replace with sprLib.rest() calls for better future compatibility.
Ensure CAML starts with <View><Query>...</Query></View> and is properly escaped.
Explicitly set Accept header in sprLib.rest() options when needed.
Include core-js or a Promise polyfill for IE11.
Use: import sprLib from 'sprestlib' (no curly braces)
Ensure default import: const sprLib = require('sprestlib'); then sprLib.list('List').items();Wrap CAML: '<View><Query><Where>...</Where></Query></View>'
Ensure the script runs on a SharePoint page with _spPageContextInfo available, or pass proper digest in headers.
No dependency data recorded yet.