Skip to content
/ dnpm Public

私有npm仓库,方便使用私有工具包

License

Notifications You must be signed in to change notification settings

dmqweb/dnpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

‼️ ‼️ ‼️ ‼️ DEPRECATED, please use https://github.com/dnpm/dnpmcore instead ‼️ ‼️ ‼️ ‼️


dnpmjs.org

(https://github.com/dnpm/dnpmjs.org/actions/workflows/nodejs.yml) Test coverage Known Vulnerabilities npm download FOSSA Status

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 dnpmjs.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 dnpm to extend npm with more features(sync command, gzip support). And it is easy to wrap for your own registry which build with dnpmjs.org.
  • Compatible with npm client: you can use the official npm client with dnpmjs.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 dnpmjs.org.

Docs

Develop on your local machine

Dependencies

  • node >= 8.0.0
  • Databases: only required one type
    • sqlite3 >= 3.0.2, we use sqlite3 by default
    • MySQL >= 5.6.16, include mysqld and mysql cli. I test on mysql@5.6.16.
    • MariaDB
    • PostgreSQL

Clone code and run test

# clone from git
$ git clone https://github.com/dnpm/dnpmjs.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 dnpmjs.org Installation Guide

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

Preparation

Dockerized dnpmjs.org control command

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

Run dockerized dnpmjs.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 dnpmjs.org web portal at http://127.0.0.1:7002 and npm register at http://127.0.0.1:7001.

Run dnpmjs.org in the backend

$docker-compose up -d

Rebuild dnpmjs.org Docker image

$docker-compose build

Remove current dockerized dnpmjs.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 "dnpmjsorg_dnpm-files-volume" & "dnpmjsorg_dnpm-db-volume".

Be Careful, the following commands will remove them.

$docker-compose rm
$docker volume rm dnpmjsorg_dnpm-files-volume
$docker volume rm dnpmjsorg_dnpm-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 dnpmjsorg_dnpm-files-volume
$docker volume inspect dnpmjsorg_dnpm-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.

Sponsors

  • 阿里云 阿里云云效 (2016.2 - now)

License

MIT

About

私有npm仓库,方便使用私有工具包

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published