Node.js can be used as an alternative to Python if you want to use Javascript instead of Python. It can run as a webserver, like Python. npm is a package manager for Node.js. It manages dependencies, and dependencies of dependencies, for Node.js projects.
The JS you can put on a CDN is client-side JS. You can download the source files and host them, or use a bundler such as https://webpack.js.org to compile them into a single file.
The advantage of any package manager over downloading source files is easy of use, you don't clog up your code repository with old files, etc.