Namespace Nite.Configuration
Classes
- NiteDirectories
Where Nite keeps per-user files, following the XDG Base Directory specification:
- Config: settings people edit (
config.json). - Cache: anything re-downloadable (tarballs, esbuild, registry metadata); safe to delete.
- Data and State: reserved for things that are neither.
Each can be overridden with
NITE_CONFIG_DIR,NITE_CACHE_DIR,NITE_DATA_DIRorNITE_STATE_DIR; otherwiseXDG_*_HOMEapplies on every OS when set (to an absolute path, as the spec requires). Defaults are the XDG ones on Linux and macOS (developers expect~/.configfrom a CLI), and the native AppData folders on Windows.- Config: settings people edit (
- NiteSettings
Effective settings, merged from (highest first):
NITE_*environment variables (NITE_REGISTRY)- the project's
nite.json(registry) - the project's
.npmrc - the user's
config.jsonin the config directory - the user's
~/.npmrc(or$NPM_CONFIG_USERCONFIG) - built-in defaults
Credentials only come from .npmrc files, so tokens stay where npm users already keep them.
- Npmrc
Reads
.npmrcfiles:key=valuelines,#/;comments, optional quotes and\({VAR}</code> expansion (<code>\){VAR?}for "empty if unset"), as npm does. Nite only acts on the registry and credential keys; everything else is ignored.
- RegistrySettings
Which registry serves which package, and which credentials go with which registry. Credentials follow npm's "nerf dart" keys (
//npm.example.com/path/:_authToken=…): a request only carries a credential when its URL is under that host and path, so a token never leaks to another host (a tarball on a CDN, say).
- SettingValue
A setting's effective value and where it came from (a file path, an environment variable, or "default").