JavaScript / Node.js

CloudRepo supports the npm registry protocol for hosting private Node.js packages.

Overview

CloudRepo provides private npm registry hosting with support for all major JavaScript package managers. Whether you’re using npm, Yarn, pnpm, or Bun, CloudRepo integrates seamlessly with your workflow.

Supported Package Formats

  • Tarballs (.tgz) - Standard npm package format

  • Scoped packages - @scope/package-name fully supported

  • Unscoped packages - Standard package-name format

Supported Tools

  • npm - The default Node.js package manager

  • Yarn (v1 and v2+) - Facebook’s package manager

  • pnpm - Fast, disk-efficient package manager

  • Bun - All-in-one JavaScript runtime with built-in package manager

Repository Types

Local Repositories

Host your private npm packages:

https://[org-id].mycloudrepo.io/repositories/npm-repo

Features:

  • Full npm publish and install support

  • Scoped and unscoped packages

  • Bearer token authentication (via npm login)

  • Basic authentication support

  • HTML directory browsing

  • 210 MB maximum package size

Quick Configuration Examples

npm

; .npmrc
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_authToken=YOUR_TOKEN
always-auth=true

Yarn (v2+)

# .yarnrc.yml
npmRegistryServer: "https://[org-id].mycloudrepo.io/repositories/npm-repo/"
npmRegistries:
  "https://[org-id].mycloudrepo.io/repositories/npm-repo/":
    npmAuthToken: "YOUR_TOKEN"

pnpm

; .npmrc (pnpm uses .npmrc)
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_authToken=YOUR_TOKEN
always-auth=true

Bun

; .npmrc (Bun falls back to .npmrc)
registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_authToken=YOUR_TOKEN
always-auth=true

Authentication Methods

Basic Authentication

For CI/CD environments, use base64-encoded credentials:

echo -n 'username:password' | base64

Then configure in .npmrc:

registry=https://[org-id].mycloudrepo.io/repositories/npm-repo/
//[org-id].mycloudrepo.io/repositories/npm-repo/:_auth=BASE64_ENCODED
always-auth=true

Best Practices

  • Always include always-auth=true in .npmrc for private registries

  • Use bearer tokens (npm login) for interactive development

  • Use base64 _auth tokens for CI/CD pipelines

  • Include a trailing slash on registry URLs

  • Use scoped packages (@yourorg/package) to avoid name conflicts

Next Steps