CouchDB
Apache CouchDB lets you access your data where you need it. The Couch Replication Protocol is implemented in a variety of projects and products that span every imaginable computing environment from globally distributed server-clusters, over mobile phones to web browsers.
Since I am working in treehouses/cli vagrant in which CouchDB docker already installed, I need to run couchDB docker.
1 | docker run -d -p 5984:984 --name=vmnet8 treehouses/couchdb:2.3.1 |
then open localhost:5984 on my browser
![](/2019/11/05/npm-analyzer-project-part-2/couch5984.png)
It shows couchDB installed
Create a new database named npms
![](/2019/11/05/npm-analyzer-project-part-2/database_npms.jpg)
visit localhost:5984/_utils, you can see the new database npms is created
![](/2019/11/05/npm-analyzer-project-part-2/npms.jpg)
Setup npm replication from https://replicate.npmjs.com/registry to npm database in continuous mode
![](/2019/11/05/npm-analyzer-project-part-2/replication.jpg)
waiting for a while, the replication will be done
![](/2019/11/05/npm-analyzer-project-part-2/replication_done.jpg)
For the replication to work, I might need to add some CouchDB config:
![](/2019/11/05/npm-analyzer-project-part-2/create_plugin.jpg)
you can see in the replication config file, the auth plugin added
![](/2019/11/05/npm-analyzer-project-part-2/add_plugin.jpg)
Creating the document _design/npms-analyzer in the npms database with the contents of https://github.com/npms-io/npms-analyzer/blob/master/config/couchdb/npms-analyzer.json
![](/2019/11/05/npm-analyzer-project-part-2/document.png)