sppull
📎 Download files from SharePoint document libraries using Node.js without hassles
Last updated
Was this helpful?
📎 Download files from SharePoint document libraries using Node.js without hassles
Last updated
Was this helpful?
Node.js module for downloading files from SharePoint document libraries.
Files streaming download:
Download files of any supported size
Effective memmory consumption while fetching large files
Performance in SPO and HTTPS environments is improved. Download on multiple objects is x2 faster now!
Smart re-download mechanism. Existing files with no changes are ignored from the download.
SharePoint Online
SharePoint On-Prem (2019, 2016, 2013)
Arguments
Context
siteUrl
- SharePoint site (SPWeb) url [string, required]
creds
username
- user name for SP authentication [string, optional in case of some auth methods]
password
- password [string, optional in case of some auth methods] ...
Additional authentication options:
Since communication module (sp-request), which is used in sppull, had received additional SharePoint authentication methods, they are also supported in sppull.
SharePoint On-Premise (Add-In permissions)
clientId
issuerId
realm
rsaPrivateKeyPath
shaThumbprint
SharePoint On-Premise (NTLM handshake - more commonly used scenario):
username
- username without domain
password
domain
/ workstation
SharePoint Online (Add-In permissions):
clientId
clientSecret
SharePoint Online (SAML based with credentials - more commonly used scenario):
username
- user name for SP authentication [string, required]
password
- password [string, required]
ADFS user credantials:
username
password
relyingParty
adfsUrl
Options
spRootFolder
- root folder in SharePoint to pull from [string, required]
dlRootFolder
- local root folder where files and folders will be saved to [string, optional, default: ./Downloads
]
spBaseFolder
- base folder path which is omitted then saving files locally [string, optional, default: equals to spRootFolder]
recursive
- to pull all files and folders recursively [boolean, optional, default: true
]
ignoreEmptyFolders
- to ignore local creation of SharePoint empty folders [boolean, optional, default: true
]
foderStructureOnly
- to ignore files, recreate only folders' structure [boolean, optional, default: false
]
strictObjects
- array of files and folders relative paths within the spRootFolder
to proceed explicitly, [array of strings, optional]
camlCondition
- SharePoint CAML conditions to use [string, optional]
spDocLibUrl
- SharePoint document library URL [string, mandatory with camlCondition
]
metaFields
- array of internal field names to request along with the files [array of strings, optional]
createEmptyFolders
- to create empty folders along with documents download task [boolean, optional, default: true
]
omitFolderPath
- folder path pattern which is omitted from final downloaded files path [string, optional]
muteConsole
- to mute console messages during transport queries to SharePoint API [boolean, optional, default: false
]
Overloads / cases
All files with folder structure from spRootFolder
Files from spRootFolder folder, first hierarchy level only
Folders structure from spRootFolder without files
Files based on array of paths provided strictly [works with array of files only right now]
Files based on CAML query conditions
Pull for documents metadata to use it in callback's custom logic
successHandler
Callback gets called upon successful files download.
errorHandler
Callback gets executed in case of exception inside sppull
. Accepts error object as first argument for callback.
For more information please check node-sp-auth and .
Use case scenarios can be found on the page. This page suggests combinations of options which are optimal for certain use cases.
Refer to the page for suggested options combinations available with sppull
.
To eliminate any local password storing if preferable to use any two-way hashing technique, like .
This project was inspired by by and by projects.
SPPull depends heavily on module and use it to send REST queries to SharePoint.