{"id":21655886,"url":"https://github.com/koltyakov/sp-download","last_synced_at":"2025-04-11T21:31:01.979Z","repository":{"id":48032822,"uuid":"100793165","full_name":"koltyakov/sp-download","owner":"koltyakov","description":"SharePoint files download client in Node.js","archived":false,"fork":false,"pushed_at":"2023-02-03T23:11:02.000Z","size":427,"stargazers_count":15,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T17:22:59.572Z","etag":null,"topics":["cli","client","download","javascript","nodejs","sharepoint","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koltyakov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-19T12:34:51.000Z","updated_at":"2024-12-20T13:52:17.000Z","dependencies_parsed_at":"2023-02-18T12:03:39.880Z","dependency_job_id":null,"html_url":"https://github.com/koltyakov/sp-download","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fsp-download","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fsp-download/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fsp-download/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koltyakov%2Fsp-download/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koltyakov","download_url":"https://codeload.github.com/koltyakov/sp-download/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248337202,"owners_count":21086975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","client","download","javascript","nodejs","sharepoint","typescript"],"created_at":"2024-11-25T08:37:38.261Z","updated_at":"2025-04-11T21:31:01.957Z","avatar_url":"https://github.com/koltyakov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sp-download - Easy to use files download client library and CLI for SharePoint in Node.js\n\n[![NPM](https://nodei.co/npm/sp-download.png?mini=true\u0026downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/sp-download/)\n\n[![npm version](https://badge.fury.io/js/sp-download.svg)](https://badge.fury.io/js/sp-download)\n[![Downloads](https://img.shields.io/npm/dm/sp-download.svg)](https://www.npmjs.com/package/sp-download)\n![Build Status](https://koltyakov.visualstudio.com/SPNode/_apis/build/status/sp-download?branchName=master)\n[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/sharepoint-node/Lobby)\n\n`sp-download` is a SharePoint files download library and CLI in Node.js.\n\n## Supported SharePoint versions\n\n- SharePoint Online\n- SharePoint 2013/2016/2019\n\n## Features\n\n- CLI \u0026\u0026 A library scenarios\n- Support robust authentication scenarios\n- Streaming download\n  - download files of any sizes\n  - no memory consumption growth\n\n## Get started\n\n### Command line (CLI)\n\n#### Prerequesites\n\n- Node.js\n\n#### Install as CLI\n\n```bash\nnpm install sp-download -g\n```\n\n### Command line (CLI) usage\n\n```bash\nsp-download --url=\"https://contoso.sharepoint.com/sites/site/lib/folder/file.ext\" --out=\"./download\"\n```\n\nor\n\n```bash\nsp-download --url=\"https://contoso.sharepoint.com/sites/site/lib/folder/file.ext\" --out=\"./download/filename.ext\"\n```\n\n#### Options\n\nPrint help:\n\n```bash\nsp-download -h\n```\n\n| Shortcut | Option | Description |\n| --- | --- | --- |\n| -V | --version | output the version number  |\n| -u | --url [value] | full path to the file in SharePoint, required |\n| -o | --out [value] | local directory or path to file where downloaded file should be saved, optional, default is `./` |\n| -c | --conf [value] | Path to private configuration file |\n| -s | --site [value] | SharePoint SPWeb url, optional, default is requested based on `url` |\n| -d | --ondemand | On-Demand auth request, optional |\n| -l | --logLevel [value] | Log level: Debug = 5, Verbose = 4, Info = 3 (default), Warning = 2, Error = 1, Off = 0 |\n| -h | --help | output usage information |\n\n### In Node.js applications\n\n#### Install as dependency\n\n```bash\nnpm install sp-download --save\n```\n\nor\n\n```bash\nyarn add sp-download\n```\n\n#### Minimal setup (TypeScript)\n\n```typescript\nimport { Download, IAuthOptions } from 'sp-download';\n\nconst authContext: IAuthOptions = {\n  // ... node-sp-auth options\n};\n\nconst download = new Download(authContext);\n\nlet filePathToDownload: string = 'https://contoso.sharepoint.com/sites/site/lib/folder/file.ext';\nlet saveToPath: string = './download';\n\ndownload.downloadFile(filePathToDownload, saveToPath)\n  .then((savedToPath) =\u003e {\n    console.log(`${argv.url} has been downloaded to ${savedToPath}`);\n  })\n  .catch((error) =\u003e {\n    console.log(error);\n  });\n```\n\n#### Minimal setup (JavaScript)\n\n```javascript\nconst Download = require('sp-download').Download;\n\nconst authContext = {\n  // ... node-sp-auth options\n};\n\nconst download = new Download(authContext);\n\nlet filePathToDownload = 'https://contoso.sharepoint.com/sites/site/lib/folder/file.ext';\nlet saveToPath = './download';\n\ndownload.downloadFile(filePathToDownload, saveToPath)\n  .then((savedToPath) =\u003e {\n    console.log(`${argv.url} has been downloaded to ${savedToPath}`);\n  })\n  .catch((error) =\u003e {\n    console.log(error);\n  });\n```\n\n## Authentication settings\n\nThe library provides a wizard-like approach for building and managing config files for [`node-sp-auth`](https://github.com/s-KaiNet/node-sp-auth) (Node.js to SharePoint unattended HTTP authentication).\n\n- SharePoint On-Premise (2013, 2016):\n  - User credentials (NTLM)\n  - Form-based authentication (FBA)\n  - Add-In Only permissions\n  - ADFS user credentials\n\n- SharePoint Online:\n  - User credentials (SAML)\n  - Add-In Only permissions\n  - ADFS user credentials\n\nFor more information please check node-sp-auth [credential options](https://github.com/s-KaiNet/node-sp-auth#params) and [wiki pages](https://github.com/s-KaiNet/node-sp-auth/wiki).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoltyakov%2Fsp-download","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoltyakov%2Fsp-download","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoltyakov%2Fsp-download/lists"}