sp-pnp-node SharePoint JavaScript核心库包装器助手

Node.js 项目的 SharePoint 集成,sp-pnp-node确实是个老朋友了。虽然现在有了更现代的方案,但它还挺适合老项目继续用的,是那种不太方便重构的代码堆。

用它配合PnPjs做 M365 的 API 调用,身份验证流程也算不上复杂,像username/passwordonBehalfOf这些策略都能搞定。

写业务代码的时候,直接用sp.setupsp.web.lists.getByTitle('xxx')那种链式风格,蛮顺手的,响应也快。你要是用过 PnPjs,在 Node 里切换到它几乎没啥学习成本。

对了,它还支持一些缓存逻辑,开发阶段调试方便,少踩坑。缺点嘛,就是文档不太全,但好在社区里也有不少参考,像Express+Passport 的身份验证样板这类文章,看看也能补不少脑。

如果你项目对 SharePoint 集成比较重,又不想搞太多 OAuth 配置的花活,可以先用着它,等以后再考虑迁移到更先进的方案,比如

zip
sp-pnp-node-master.zip 预估大小:35个文件
folder
sp-pnp-node-master 文件夹
file
.gitignore 54B
file
Dockerfile 142B
file
package.json 2KB
file
package-lock.json 137KB
folder
src 文件夹
file
PnpNodeM.ts 781B
file
IPnpNode.ts 579B
file
index.ts 133B
file
PnpNode.ts 4KB
file
utils.ts 1KB
file
LICENSE 1KB
file
tsconfig.json 508B
folder
.github 文件夹
file
PULL_REQUEST_TEMPLATE.md 256B
folder
examples 文件夹
file
pnp-ambient.ts 471B
file
pnp-factory.ts 605B
file
fetch-ambient.ts 312B
file
README.md 1KB
file
pnp-ambient.js 375B
file
.eslintrc.js 507B
file
README.md 8KB
file
.eslintignore 42B
folder
.vscode 文件夹
file
settings.json 27B
file
azure-pipelines.yml 406B
file
.npmignore 95B
folder
docs 文件夹
file
demo.gif 169KB
file
intro.md 5KB
folder
test 文件夹
file
auth.ts 1KB
file
interfaces.ts 456B
folder
bench 文件夹
file
benchmark.ts 1KB
file
tests.spec.ts 9KB
folder
multiproc 文件夹
file
runner.ts 880B
file
index.ts 1KB
file
instanced.ts 1KB
file
.mocharc.json 145B
file
init.ts 835B
file
configs.ts 1KB
zip 文件大小:203.62KB