That's one problem it solves, but NPM is really just a frontend for Nginx Reverse Proxy.
And a reverse proxy is one of the basic security steps you need to take when exposing something to the open Internet. You want everything forwarded through it and spend most of your time hardening it and the server it's running on (and it should be the only thing running on that server, all other services should be running elsewhere, ideally)