A lightweight private npm proxy registry application with comprehensive package management, authentication, and web interface capabilities
—
Configuration parsing, validation, and management utilities for Verdaccio server setup and customization.
Parse and validate Verdaccio configuration files with automatic path resolution.
/**
* Parse Verdaccio configuration file with validation and defaults
* @param configPath - Absolute path to configuration file (YAML format)
* @returns Parsed and validated configuration object
* @throws Error if file doesn't exist or contains invalid YAML
*/
function parseConfigFile(configPath: string): any;Usage Examples:
import { parseConfigFile } from "verdaccio";
// Parse configuration file
const config = parseConfigFile("/path/to/config.yaml");
// Configuration is ready to use
const server = await runServer(config);Utility class for programmatically building Verdaccio configurations.
/**
* Configuration builder utility class for programmatic config creation
*/
class ConfigBuilder {
/**
* Build configuration with validation and defaults
*/
static build(options: any): any;
}Locate Verdaccio configuration files using standard search paths.
/**
* Find configuration file using standard search locations
* @param customPath - Optional custom configuration file path
* @returns Absolute path to configuration file
* @throws Error if no configuration file found
*/
function findConfigFile(customPath?: string): string;Search order:
./config.yaml (current directory)~/.config/verdaccio/config.yaml (user config)/etc/verdaccio/config.yaml (system config)# Storage location for packages and metadata
storage: ./storage
# Authentication providers
auth:
htpasswd:
file: ./htpasswd
max_users: 1000
# Upstream registry links
uplinks:
npmjs:
url: https://registry.npmjs.org/
timeout: 30s
max_fails: 2
# Package access control
packages:
'@private/*':
access: $authenticated
publish: $authenticated
'**':
access: $all
publish: $authenticated
proxy: npmjs
# Server settings
listen: 0.0.0.0:4873
# Web interface
web:
enable: true
title: Verdaccio
# Logging configuration
logs:
- { type: stdout, format: pretty, level: info }interface StorageConfig {
/** Storage directory path */
storage: string;
/** Plugin configuration for custom storage */
store?: {
[pluginName: string]: any;
};
}interface AuthConfig {
/** Built-in htpasswd authentication */
htpasswd?: {
file: string;
max_users?: number;
};
/** Plugin-based authentication */
[pluginName: string]: any;
}interface UplinksConfig {
[uplinkName: string]: {
url: string;
timeout?: string;
max_fails?: number;
fail_timeout?: string;
headers?: { [key: string]: string };
ca?: string;
cert?: string;
key?: string;
strict_ssl?: boolean;
};
}interface PackagesConfig {
[pattern: string]: {
access: string | string[];
publish: string | string[];
proxy?: string | string[];
storage?: string;
};
}interface ServerConfig {
/** Listen address and port */
listen?: string | string[];
/** HTTPS configuration */
https?: {
key?: string;
cert?: string;
ca?: string;
pfx?: string;
passphrase?: string;
};
/** Keep-alive timeout in seconds */
keepAliveTimeout?: number;
/** Trust proxy headers */
trustProxy?: boolean | string | string[];
}interface WebConfig {
/** Enable web interface */
enable?: boolean;
/** Web interface title */
title?: string;
/** Custom logo URL */
logo?: string;
/** Primary color theme */
primary_color?: string;
/** Login functionality */
login?: boolean;
/** Package scope filters */
scope?: string;
}interface LogConfig {
type: 'stdout' | 'stderr' | 'file';
format: 'pretty' | 'pretty-timestamped' | 'json';
level: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
path?: string; // for file type
}storage: Must be a valid directory pathauth: At least one authentication methodpackages: At least one package patternuplinks: Defaults to npmjs.org if not specifiedlisten: Defaults to localhost:4873web: Defaults to enabledlogs: Defaults to pretty stdout loggingConfiguration files support environment variable substitution:
storage: ${VERDACCIO_STORAGE_PATH:-./storage}
listen: ${VERDACCIO_PORT:-4873}
auth:
htpasswd:
file: ${VERDACCIO_HTPASSWD_FILE:-./htpasswd}storage: ./storage
auth:
htpasswd:
file: ./htpasswd
packages:
'**':
access: $all
publish: $authenticatedstorage: /var/lib/verdaccio/storage
auth:
ldap:
url: ldap://ldap.company.com
baseDN: 'ou=people,dc=company,dc=com'
uplinks:
npmjs:
url: https://registry.npmjs.org/
internal:
url: https://internal-registry.company.com/
packages:
'@company/*':
access: $authenticated
publish: $authenticated
storage: company-packages
'**':
access: $all
publish: $authenticated
proxy: npmjs
listen: 0.0.0.0:4873
https:
key: /etc/ssl/private/verdaccio.key
cert: /etc/ssl/certs/verdaccio.crt
web:
title: Company NPM Registry
logo: https://company.com/logo.png
primary_color: "#4CAF50"
logs:
- { type: file, path: /var/log/verdaccio/verdaccio.log, level: info }Install with Tessl CLI
npx tessl i tessl/npm-verdaccio