Standardize npm registry HTTP API

84 views
Skip to first unread message

Francesco Mari

unread,
Feb 6, 2014, 8:14:19 AM2/6/14
to nod...@googlegroups.com
In the last few days I played around with a local npm registry mirror, and I went through some code from the NPM tool and related utility modules.

I found out that the current HTTP API exposed from the npm registry is too tied to the CouchDB HTTP API, especially regarding authentication, authorization and module updates (e.g. attachments API). Some parts of the API, on the other hand, are not really useful to the core usage of the npm tool, and I think they are mainly there to satisfy the needs of the npmjs.org website (e.g. stars by users, stars by package, latest packages, etc.).

I think that the whole ecosystem could benefit from a standardization of the core HTTP API. If we define the behaviour that the npm tool expects to correctly work, and the core functionalities that must be supported, it could be way easier to implement different variations of an npm server. Given a stable API, different implementations of the npm server could be written, with different options about data storage, additional features, different authentication methods and so on.

I hope that in the (near) future a community effort could be done to produce a stable version of the npm API. What do you think about it?

Alex Kocharin

unread,
Feb 6, 2014, 12:40:53 PM2/6/14
to nod...@googlegroups.com
 
+1
 
Different non-couchdb implementations already exist, but npm can change protocol at any point of time (npm v1.3.19), and all these tools need to be changed accordingly.
 
I'd much rather see npm own protocol rather than couchdb. It feels like a classic example of a vendor locking right now.
 
 
06.02.2014, 17:14, "Francesco Mari" <mari.fr...@gmail.com>:
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Francesco Mari

unread,
Feb 6, 2014, 7:26:55 PM2/6/14
to nod...@googlegroups.com
I will try to flesh out a more detailed description of what I expect
(theoretically) from the HTTP API exposed by an npm registry. That
will be only my personal point of view, but I hope that it will help
to start a productive discussion with the community.

2014-02-06 Alex Kocharin <al...@kocharin.ru>:
> You received this message because you are subscribed to a topic in the
> Google Groups "nodejs" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/nodejs/wRnpyOSQqak/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

tjholowaychuk

unread,
Feb 6, 2014, 10:47:49 PM2/6/14
to nod...@googlegroups.com
big +1 from me, the API Couch gives you is awful to work with

Stefan Guggisberg

unread,
Feb 7, 2014, 5:45:53 AM2/7/14
to nod...@googlegroups.com
+1 for a clean and lean npm core HTTP API.
writing a npm registry shouldn't be that hard.

Francesco Mari

unread,
Feb 7, 2014, 10:25:54 AM2/7/14
to nod...@googlegroups.com
I wrote a first, very minimal draft of what I expect from the npm HTTP
API. You can find it here:
https://gist.github.com/francescomari/8864751. Any kind of feedback is
welcome, looking forward to your opinions.

2014-02-07 Stefan Guggisberg <stefan.g...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages