PnP-JS-Core open web by url?

New Contributor

Every example I see of PnP-JS-Core uses the current web. How can I open a list from another web?

3 Replies
have not seen the code but i guess you need to create your own clientcontext with site url and then go to the correct web.

That's how you do it with CSOM, but PNP-Core is a wrapper for the REST services. Makes lots of things easier, but documentation is sketchy. Thanks for the response.

best response confirmed by Clifford Adams (New Contributor)

For anyone else searching for this. Here's how you do it:

var w = new $pnp.Web("/news");