sharepoint-files
v1.0.0
Published
M365 SharePoint file access via Microsoft Graph API — auth, drive discovery, file listing, download, and text extraction
Maintainers
Readme
sharepoint-files
Minimal Microsoft Graph client for SharePoint file access and text extraction.
Features
- Client-credentials authentication
- Site and drive discovery
- Folder traversal and file listing
- File download helpers
- Plain-text extraction from common Office files
Install
npm install sharepoint-filesUsage
import { createSharePointClient } from "sharepoint-files";
const client = createSharePointClient({
tenantId: process.env.MICROSOFT_TENANT_ID!,
clientId: process.env.MICROSOFT_CLIENT_ID!,
clientSecret: process.env.MICROSOFT_CLIENT_SECRET!,
});
const site = await client.getSite("contoso.sharepoint.com:/sites/Research");
const drives = await client.listDrives(site.id);Notes
- Uses the Graph API directly
- Designed for service-to-service use
- Secrets must be provided via environment variables or host config
Good fit for ingestion jobs, knowledge sync tools, and internal search systems.
