There are multiple ways to access lists and they all start from the Web object. You can access a list if you know the list's web relative URL address, title, or ID:
// get list by web relative url pnp.sp.web.getList("/Shared Documents").get().then((list: List) => { console.log(list); }); // get list by title pnp.sp.web.lists.getByTitle("Documents").get().then((list: List) => { console.log(list); }); // get list by id pnp.sp.web.lists.getById("267acf5a-151b-4dbf-b65b-545ed382a425").get().then((list: List) => { console.log(list); });
In the previous example, we are using the console.log object, which is an excellent way to examine the returned object. You can easily find out all of the properties of the object via your browser's developer tools Console window:
![](https://static.packt-cdn.com/products/9781787121430/graphics/assets/3b8202e0-f90a-457a-967e-4bca46b3a79a.png)
In some cases, we need to change the type of the returned object to any, in order to actually access all properties. For example...