This repository was archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
Install and Use
Russell gove edited this page May 20, 2016
·
24 revisions
-
NPM Install
npm install sp-pnp-js --save -
Import to TypeScript file
import pnp from "sp-pnp-js"; -
Begin using the API
pnp.sp.web.get().then(...)
You can also import parts of the library into your project to use them directly:
import { objectIsNull } from "sp-pnp-js/lib/utils/args";
let b = objectIsNull(null); //true
-
**Download pnp.js from hete ???
-
**Upload pnp.js to your site. In this example we will upload it to a library called "Style Library"
-
Add a new file called testpnp.html to the same library with the following content.
<script type="text/javascript" src="{PathToYourSite}/Style%20Library/pnp/pnp.js"></script><script type="text/javascript" src="{PathToYourSite}/Style%20Library/pnp/pnptest.js"></script><div id="main"></div>
Sharing is caring!