6

Till date we are coding custom solutions in SharePoint using JavaScript/jQuery/REST API, I need to know if there are any downfalls of using PNP JS as an alternate to REST? My company is pushing all developers to code using PNP JS library. Is it worth learning PNP JS or should we stick to jQuery/REST?

5

For me the answer is pretty obvious: for sure you should use it.

A few things why I think so:

  • the learning curve is very straightforward and not so difficult
  • pnpjs is a wrapper on REST API, by using jQuery\REST you will create your own "pnpjs". In that case, why reinvent the wheel?
  • pnpjs has some other things except just wrapping around REST. For example caching, batching, managed metadata support (which is not supported in REST yet)
  • fluent interface is awesome in pnpjs. I believe you have less typo errors and regression bugs with pnpjs
  • your code is cleaner, as a result easier to maintain

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.