Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Different Sync Modes

alsotang edited this page Sep 3, 2019 · 1 revision

cnpmjs.org support several kind of modes. So you can use it to do different things.

TL;DR

  • If you want to build a NPM mirror, please chose private mode(config.enablePrivate = true).
  • If you want to build a private NPM registry for companies
    • do not need scope: choose public mode(config.enablePrivate = false && config.scopes = null)
    • want scope: choose public mode with scope, and force user publish private modules with scope.(config.enablePrivate = false && config.scopes = ['@yourscope'] && config.forcePublishWithScope = true)

Private Mode

Usage: NPM mirror

  • config.enablePrivate = true
  • Everyone can install from this registry
  • Only admins can publish to this registry

Private + Scope Mode

  • config.enablePrivate = true && config.scopes = ['@cnpm', '@cnpmtest']
  • Everyone can install from this registry
  • Only admins can publish to this registry
  • Can publish with scope, and only in @cnpm and @cnpmtest

Public Mode

Usage: Private NPM Registry for companies

  • config.enablePrivate = false
  • Everyone can install from this registry
  • Any logined user can publish to this registry
  • Admins can unpublish any module, add author to any module

Public + Scope Mode

  • config.enablePrivate = false && config.scopes = ['@cnpm', '@cnpmtest']
  • Everyone can install from this registry
  • Any logined user can publish, and modules allow with scope @cnpm or @cnpmtest
  • Admins can unpublish any module, add author to any module

Public + Scope + ForcePublishWithScope Mode

  • config.enablePrivate = false && config.scopes = ['@cnpm', '@cnpmtest'] && config.forcePublishWithScope = true
  • Everyone can install from this registry
  • Any logined user can publish, but modules must with scope @cnpm or @cnpmtest
  • Admins can unpublish any module, add author to any module