Miss any of our Open RFC calls?Watch the recordings here! »

@paulholden/sharepoint

0.1.10 • Public • Published

sharepoint

Promise-based library for interacting with SharePoint Online.

Getting Started

const Sharepoint = require('@paulholden2/sharepoint')
const sp = new Sharepoint('URL HERE')

sp.authenticate()
sp.getWebEndpoint()
sp.getContents(path)
sp.createFolder(path)
sp.deleteFolder(path)
sp.createFile(options) // options = { path, fileName, data }
sp.deleteFile(options) // options = { path, fileName }
sp.createFileChunked(options) // options = { path, fileName, stream, fileSize, chunkSize }

Test

First, set these to match your SharePoint environment:

Env Variable Value
SHAREPOINT_URL Your test/sandbox SharePoint site https://example.sharepoint.com/sites/YourSite/.
SHAREPOINT_USERNAME User Principal Name of the user you wish to test with, e.g. john.doe@example.com.
SHAREPOINT_PASSWORD Password for your SHAREPOINT_USERNAME.
SHAREPOINT_DIR_PATH Path to where the files are. e.g. /Shared Documents/General.
SHAREPOINT_LIST An existing list that can be tested against.
  • Alternatively, you can edit a /.env file if you prefer (as per dotenv)

Then, run:

npm run test

License

MIT

Install

npm i @paulholden/sharepoint

DownloadsWeekly Downloads

2

Version

0.1.10

License

MIT

Unpacked Size

48.4 kB

Total Files

12

Last publish

Collaborators

  • avatar