rc-config-loader
- Version 5.0.0
- Published
- 56.3 kB
- 3 dependencies
- MIT license
Install
npm i rc-config-loaderyarn add rc-config-loaderpnpm add rc-config-loaderOverview
load config file from .{product}rc.{json,yml,js,ts}
Index
Functions
Functions
function loadConfigFile
loadConfigFile: <R extends {}>( filePath: string, opts?: loadConfigFileOption) => rcConfigResult<R>;Load exactly one config file, return { config, filePath } -
filePathis resolved fromopts.cwd(default:process.cwd()) - It does not search parent directories, does not append any extension, and does not readpackage.json- The loader is selected by the extension offilePath-.json→ JSON,.yaml/.yml→ YAML,.js/.cjs/.mjs→ JavaScript,.ts/.cts/.mts→ TypeScript - Other names like.secretlintrcare tried as JSON, YAML, then JavaScript (in order ofextensions) - If the file does not exist, throw an Error that hascode: "ENOENT"- If the file can not be parsed, throw an ErrorParameter filePath
Parameter opts
Returns
{{ config: Object, filePath:string }}
function rcFile
rcFile: <R extends {}>( pkgName: string, opts?: rcConfigLoaderOption) => PossibleUndefined<rcConfigResult<R>>;Find and load rcfile, return { config, filePath } If not found any rcfile, throw an Error.
Parameter pkgName
Parameter opts
Returns
{{ config: Object, filePath:string } | undefined}
Package Files (1)
Dependencies (3)
Dev Dependencies (6)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/rc-config-loader.
- Markdown[](https://www.jsdocs.io/package/rc-config-loader)
- HTML<a href="https://www.jsdocs.io/package/rc-config-loader"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3198 ms. - Missing or incorrect documentation? Open an issue for this package.
