Registry

Registry URL

NPM_REGISTRY=https://registry.npmjs.org
config :npm, registry: "https://registry.npmjs.org"

Token

NPM_TOKEN=npm_...
config :npm, token: System.get_env("NPM_TOKEN")

Mirror

NPM_MIRROR=https://registry.npmmirror.com
config :npm, mirror: "https://registry.npmmirror.com"

Paths

Cache root

NPM_EX_CACHE_DIR=~/.npm_ex
config :npm, cache_dir: Path.expand("~/.npm_ex")

Runtime installs

NPM_INSTALL_DIR=/tmp/npm-installs
config :npm, install_dir: "/tmp/npm-installs"

Security Policy

Block transitive exotic deps

NPM_EX_BLOCK_EXOTIC_SUBDEPS=true
config :npm, block_exotic_subdeps: true

Allow direct exotic deps

NPM_EX_EXOTIC_DEPS=github:org/repo#sha
config :npm, exotic_deps: ["github:org/repo#sha"]

Allowed registries

NPM_EX_ALLOWED_REGISTRIES=https://registry.npmjs.org
config :npm, allowed_registries: ["https://registry.npmjs.org"]

Redirects

NPM_EX_ALLOW_REGISTRY_REDIRECTS=false
config :npm, allow_registry_redirects: false

Warnings

Package age

NPM_EX_PACKAGE_AGE_WARNING_DAYS=7
config :npm, package_age_warning_days: 7

Version age

NPM_EX_VERSION_AGE_WARNING_DAYS=3
config :npm, version_age_warning_days: 3

Compromised Packages

DB path

NPM_EX_COMPROMISED_DB_PATH=~/.npm_ex/security/compromised_packages.json
config :npm, compromised_db_path: Path.expand("~/.npm_ex/security/compromised_packages.json")

Policy

NPM_EX_COMPROMISED_POLICY=error
config :npm, compromised_policy: :error

Inspect

Effective config

mix npm.config