Use cnpmjs.org and your own nfs to build your own npm
- hello cnpm - The most simple way to use
cnpmjs.org, default cnpm is private mode, work as a NPM mirror. - culster - Use cluster mode to make your system more stable and reliable
- cloud storgae service - Use qiniu cloud storage service to store tarballs
- simple filesytem - Use sfs to store tarballs
- public registry - Build a public registry with scope support, use for enterprise private registry
- Node.js: To run cnpm, please install node v0.11+.
- Mysql
npm install
mysql -uroot -e 'DROP DATABASE IF EXISTS cnpmjs_test;' &&\
mysql -uroot -e 'CREATE DATABASE cnpmjs_test;' &&\
mysql -uroot 'cnpmjs_test' < node_modules/cnpmjs.org/docs/db.sql &&\
mysql -uroot 'cnpmjs_test' -e 'show tables;'
Or you can find all table sqls in cnpmjs.org/docs/db.sql.
Step one: start server
# start simple sample
$ node --harmony hello_cnpm
# start cluster sample
$ node --harmony cluster
# start sfs sample
$ node --harmony sfsStep two: wrap cnpm cli for test your own registry
# install cnpm cli first
$ npm install cnpm -g
# alias lnpm to cnpm for test
$ alias lnpm='cnpm --registry=http://localhost:7001 \
--registryweb=http://localhost:7002 \
--cache=$HOME/.npm/.cache/lnpm \
--userconfig=$HOME/.lnpmrc'
Now you can use lnpm to play with yoru own registry:
$ lnpm sync moduletest
$ lnpm install moduletest
# do whatever npm supportedYou can replace the default filesystem storage by any other file store system, only need to follow this guide.
We provide several cloud storage service wrapper for cnpm. Just check it out.
MIT