The Wayback Machine - https://web.archive.org/web/20200618091129/https://github.com/cnpm/cnpmjs.org
Skip to content
Private npm registry and web for Enterprise
JavaScript CSS HTML Other
Branch: master
Clone or download

Latest commit

Latest commit 5e98591 Apr 10, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin fix: "start" should wait for "stop" to remove the pid file(using Prom… Sep 5, 2017
common feat: add redis cache to import list all versions api perf (#1441) Feb 26, 2019
config feat: support custom web middlewares (#1563) Apr 10, 2020
controllers feat: list all package versions by date (#1557) Feb 23, 2020
docs refactor: normalize database structure (#1376) Sep 4, 2018
lib feat: list all package versions by date (#1557) Feb 23, 2020
middleware fix: maintainer permission greater than scope (#1494) Aug 21, 2019
models refactor: normalize database structure (#1376) Sep 4, 2018
public fix: Don't display sync info when the sync mode is none (#1410) Nov 20, 2018
routes feat: list all package versions by date (#1557) Feb 23, 2020
servers feat: support custom web middlewares (#1563) Apr 10, 2020
services feat: list all package versions by date (#1557) Feb 23, 2020
sync fix: changes stream syncer without deps Apr 29, 2019
test feat: support custom web middlewares (#1563) Apr 10, 2020
tools fix: try to sync from official replicate (#1076) Nov 19, 2016
view/web fix: use <%- instead of <%= in user profile page (#1404) Nov 7, 2018
.dockerignore docs: Dockerized cnpmjs.org configuration with installation guide (#1191 Jun 13, 2017
.editorconfig update editorconfig Nov 25, 2014
.gitignore feat: proxy npm audit request (#1419) Jan 22, 2019
.jshintignore feat: list packages by username Sep 28, 2015
.jshintrc mv proxy/module.js into services/package.js Oct 15, 2014
.node-dev.json feat(mock): use koa-mock for front end dev Nov 21, 2014
.npmignore docs: Deploy a private npm registry in 5 minutes Feb 3, 2015
.travis.yml feat: show versions list on package page (#1386) Sep 14, 2018
AUTHORS Release 2.19.0 Dec 20, 2016
CONTRIBUTING.md add contribute guidelines Apr 9, 2014
Dockerfile fix: cpu usage 100% in [email protected] (#1470) May 24, 2019
History.md refactor: use yield instead of yield* Aug 21, 2017
LICENSE.txt fix: should sync missing public scoped package on install (#946) Jun 5, 2016
Makefile refactor: use koa-rt, koa-rewrite, koa-conditional-get, koa-etag Aug 21, 2017
README.md update readme for now situation (#1506) Sep 4, 2019
dispatch.js feat: add changes stream syncer (#970) Jun 25, 2016
docker-compose.yml docs: Dockerized cnpmjs.org configuration with installation guide (#1191 Jun 13, 2017
index.js feat: list packages by username Sep 28, 2015
logo.png add module controller test cases; fix next module not exists logic bug. Dec 5, 2013
package.json Release 3.0.0-rc.32 Apr 10, 2020
worker.js feat: enable maxrequests middleware (#1003) Jul 26, 2016

README.md

cnpmjs.org

npm version build status Test coverage Known Vulnerabilities npm download

logo

Description

Private npm registry and web for Enterprise, base on koa, MySQL and Simple Store Service.

Our goal is to provide a low cost maintenance, easy to use, and easy to scale solution for private npm.

What can you do with cnpmjs.org?

  • Build a private npm for your own enterprise. (alibaba is using cnpmjs.org now)
  • Build a npm mirror. (we use it to build a mirror in China: https://npm.taobao.org/)

Features

  • Support "scoped" packages: npm/npm#5239
  • Support CORS
  • Simple to deploy: only need mysql and a simple store system.
  • Low cost and easy maintenance: package.json info can store in MySQL, MariaDB, SQLite or PostgreSQL. tarball(tgz file) can store in Amazon S3 or other object storage service.
  • Automatic synchronization: automatically sync from any registry specified. support two sync modes:
    • Sync all modules from upstream
    • Only sync the modules after first access.
  • Manual synchronization: automatic synchronization may has little delay. you can sync manually on web page.
  • Customized client: we provide a client cnpm to extend npm with more features(sync command, gzip support). And it is easy to wrap for your own registry which build with cnpmjs.org.
  • Compatible with npm client: you can use the official npm client with cnpmjs.org. you only need to change the registry in client config.
  • Support http_proxy: if you're behind a firewall, you can provide a http proxy for cnpmjs.org.

Docs

Develop on your local machine

Dependencies

  • node >= 8.0.0
  • Databases: only required one type

Clone code and run test

# clone from git
$ git clone https://github.com/cnpm/cnpmjs.org.git

# install dependencies
$ make install

# test
$ make test

# coverage
$ make test-cov

# update dependencies
$ make autod

# start server with development mode
$ make dev

Dockerized cnpmjs.org Installation Guide

Cnpmjs.org shipped with a simple but pragmatic Docker Compose configuration.With the configuration, you can set up a MySQL backend cnpmjs.org instance by executing just one command on Docker installed environment.

Preparation

Dockerized cnpmjs.org control command

Make sure your current working directory is the root of this GitHub repository.

Run dockerized cnpmjs.org
 $docker-compose up

This command will build a Docker image using the current code of repository. Then set up a dockerized MySQL instance with data initialized. After Docker container running, you can access your cnpmjs.org web portal at http://127.0.0.1:7002 and npm register at http://127.0.0.1:7001.

Run cnpmjs.org in the backend

$docker-compose up -d

Rebuild cnpmjs.org Docker image

$docker-compose build

Remove current dockerized cnpmjs.org instance

The current configuration set 2 named Docker Volume for your persistent data. If you haven't change the repository directory name, them will be "cnpmjsorg_cnpm-files-volume" & "cnpmjsorg_cnpm-db-volume".

Be Careful, the following commands will remove them.

$docker-compose rm
$docker volume rm cnpmjsorg_cnpm-files-volume
$docker volume rm cnpmjsorg_cnpm-db-volume

You can get more information about your data volumes using the below commands:

$docker volume ls  // list all of your Docker volume
$docker volume inspect cnpmjsorg_cnpm-files-volume
$docker volume inspect cnpmjsorg_cnpm-db-volume

How to contribute

  • Clone the project
  • Checkout a new branch
  • Add new features or fix bugs in the new branch
  • Make a pull request and we will review it ASAP

Tips: make sure your code is following the node-style-guide.

Top contributors

0 1 2 3 4 5 6 7

Sponsors

  • 阿里云 (2016.2 - now)

License

MIT

You can’t perform that action at this time.