Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java plugin for installing npm modules

Tags:

java

node.js

npm

Hi i am developing a sdk in java, in the sdk the users will provide the node modules names. Is there any way to download those npm packages in java with all its dependencies without forcing the end user to install npm?

like image 922
SathishBabu Avatar asked Apr 11 '26 16:04

SathishBabu


1 Answers

You can start by studying npm's registry api. You can look for packages by appending the package name at the end like this http://registry.npmjs.org/express and you just have to parse the returned json and look for the latest tarball urls (if you're looking for the latest distribution, else you can code your plugin to look for specific versions). And then look for the dependencies entries and do the same for them (access the api and download the tarballs). You can actually find more info at their docs.

like image 110
paolord Avatar answered Apr 13 '26 07:04

paolord



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!