npm

@armit/config-loader
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

@armit/config-loader

Find and load configuration from a package.json property, rc file, or CommonJS module, also support .ts file type:

it will search up the directory tree, checking each of these places in each directory, until it finds some acceptable configuration (or hits the home directory).

config loader support below config file pattern

'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.ts`,
// cjs
`.${moduleName}rc.cjs`,
`${moduleName}.config.cjs`,

// esm with `type:module`, otherwise `cjs`
`${moduleName}.config.js`,
// esm with `type:module`, otherwise `cjs`
`${moduleName}.config.ts`,

// esm
`${moduleName}.config.mts`,
`${moduleName}.config.mjs`,

Package Sidebar

Install

npm i @armit/config-loader

Weekly Downloads

48

Version

0.3.0

License

MIT

Unpacked Size

48 kB

Total Files

45

Last publish

Collaborators

  • hyperse.net
  • tianyingchun