Experiment : NPM registry server with Serverless

Michael Grenier
2 min readJul 15, 2016

--

Not long ago, I went on the path of Serverless for an experiment as a mean to learn what was all the fuss about. Turns out I built a NPM registry server while learning all about serverless development.

For those of you willing to peek at the code, here’s the github repository : serverless-npm-registry.

I’ve been working with Amazon AWS services for quite a while now, maybe 4 years, and always wondered if someday there will be a way to just don’t care about servers : after all, all I care is to deploy my code.

Amazon’s Lambda and API Gateway came along and some very skilled engineer set their goal to provide other developer the means to develop code and deploy it effortlessly on these services. Serverless came a thing. Serverless framework is a smart layer of abstraction around your lambda functions and desired API endpoints.

NPM registry, where every package are stored and can be interact with the npm cli, is built on a very simple REST API. Just by configuring my npm client to use a custom registry, I was able to intercept most of the common API call and recreate them in nodejs. Then it was quite simple to wrap my code in a serverless project and deploy it on AWS. I used Dynamo as the database thus making it 100% serverless.

--

--