Giter VIP home page Giter VIP logo

sharepoint's Introduction

sharepoint

Tymly Package npm (scoped) CircleCI CodeFactor Dependabot badge Commitizen friendly JavaScript Style Guide license

Adventures in uploading/listing/downloading documents in Microsoft SharePoint Online... using Node.js

Getting Started

const Sharepoint = require('@wmfs/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 This is the site we're aiming for, so something like https://example.sharepoint.com/sites/YourSite/
SHAREPOINT_USERNAME The username you want to connect to SharePoint with. Note this is the full username with an @, so something like [email protected]
SHAREPOINT_PASSWORD And yup, the password to accompany SHAREPOINT_USERNAME.
SHAREPOINT_DIR_PATH Path to where the files are. e.g. /Shared Documents/General
  • Alternatively, you can edit a /.env file if you prefer (as per dotenv)

Then, run:

npm run test

License

MIT

sharepoint's People

Contributors

dependabot-preview[bot] avatar meenahoda avatar exactlyaron avatar semantic-release-bot avatar wmfs-bot avatar tflanagan avatar jezhiggins avatar viktor992 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.