seniority/rc
Every export of seniority/rc, with its signature and doc comment: parse, rc, rc, plus 3 types.
import rc from 'seniority/rc';
import { parse, rc } from 'seniority/rc';Functions
default
The default export, declared as rc.
rc, with its world as an argument.
function rc(name: string, defaults?: RcConfig | string, argv?: RcConfig, parseWith?: RcParse, options?: RcOptions): RcConfig;| Parameter | Type |
|---|---|
name | string |
defaults (optional) | RcConfig | string |
argv (optional) | RcConfig |
parseWith (optional) | RcParse |
options (optional) | RcOptions |
Returns RcConfig
module.exports
What require() returns: the default export, rc, under the name Node's require(esm) reads.
parse
rc's own cc.parse: a document starting with { is JSON — comments allowed — and anything
else is INI, which this package does not bundle a parser for (constraint 3). The refusal
names parse, rc's fourth parameter, so supplying ini.parse is one argument.
function parse(content: string): RcConfig;| Parameter | Type |
|---|---|
content | string |
Returns RcConfig
rc
rc, with its world as an argument.
function rc(name: string, defaults?: RcConfig | string, argv?: RcConfig, parseWith?: RcParse, options?: RcOptions): RcConfig;| Parameter | Type |
|---|---|
name | string |
defaults (optional) | RcConfig | string |
argv (optional) | RcConfig |
parseWith (optional) | RcParse |
options (optional) | RcOptions |
Returns RcConfig
Interfaces
RcOptions
The world, as an argument (R11). Every field has a default that touches no process:
cwd resolves the empty path, home asks os, and env is empty — because guessing
an environment is worse than not having one, which is the call seniority/dotenv already
makes for processEnv.
interface RcOptions {
/** The environment to read `<NAME>_*` from; the process's own when omitted, as rc does (D-135). */
env?: Record<string, string | undefined>;
/** Where the upward walk for `.<name>rc` starts. */
cwd?: string;
/** The home directory the four `~` places hang off. */
home?: string;
/** Skip the `/etc` places, as rc does on Windows — and, as rc, by default only there. */
win?: boolean;
}Types
RcConfig
A parsed config document. rc places no shape on it, and neither does this.
type RcConfig = Record<string, unknown>;RcParse
rc's fourth parameter: turn a file's text into an object.
type RcParse = (content: string) => RcConfig;seniority/lilconfig
Every export of seniority/lilconfig, with its signature and doc comment: lilconfig, lilconfigSync, defaultLoadersSync, defaultLoaders, plus 11 types.
seniority/find-up
Every export of seniority/find-up, with its signature and doc comment: findUpMultipleSync, findUpMultiple, findUpSync, findUp, findDownSync, findDown and 1 more, plus 3 types.