PnPJS Introduction

 PnPJS (Patterns and Practices Client-side Libraries):

  • PnPjs is a collection of fluent libraries for consuming SharePoint, Graph, and Office 365 REST APIs in a type-safe way.
  • You can use it with SharePoint Framework, Nodejs, or JavaScript projects.
  • Install PnPJS in SPFx use the below commant.(Latest version 2.14.0 as of Nov 2022)
    npm install @pnp/logging @pnp/common @pnp/odata @pnp/sp --save


PnP Packages:

    Below are the some basic packages we can use.

  • @pnp/common  – Provides shared functionality across all pnp libraries
  • @pnp/config-store  – Provides a way to manage configuration within your application
  • @pnp/graph – Provides a fluent API for working with Microsoft Graph
  • @pnp/logging  – Light-weight, subscribable logging framework
  • @pnp/nodejs  – Provides functionality enabling the @pnp libraries within nodejs
  • @pnp/odata – Provides shared odata functionality and base classes
  • @pnp/pnpjs – Rollup library of core functionality (mimics sp-pnp-js structure in previous version)
  • @pnp/sp  – Provides a fluent API for working with SharePoint REST
  • @pnp/sp-addinhelpers  – Provides functionality for working within SharePoint add-ins



More details Video LinkLink2

Comments

Popular posts from this blog

Upload Single/Multiple file by using the REST API and jQuery SharePoint 2013

Add content type to SharePoint List/Library using REST API

A type named 'SP.Data. could not be resolved by the model error