jeudi 26 mars 2015

Load multiple versions of a package in npm

I am setting up a web API and I'd like to offer multiple versions of the underlying library.


In short, I'd like to call it with: http://myapi/x.y.z/method where x.y.z is the version of the underlying library I'm using.


I'm using npm to handle my libraries and seem to be able to specify only one version of the dependencies.


I thought about manually downloading each versions in sub folders of my service but I'm not a big fan of it. Instead, I'd like to just have a list of allowed versions in my config and that it loads them at service start-up for future use.


What's the best way to achieve multi-versions API on a JavaScript web service? I'm open to other package managers as well (instead of npm).





Aucun commentaire:

Enregistrer un commentaire