Skip to content

An out-of-the-box config loader with TypeScript support.

License

Notifications You must be signed in to change notification settings

ulivz/load-config-ts

Repository files navigation

load-config-ts

An out-of-the-box config loader with TypeScript support.

NPM version NPM downloads Build Status

Install

npm i load-config-ts -S

Usage

import { loadConfig } from 'load-config-ts';
// This load try to load at process.cwd():
//   - ulivz.config.js
//   - ulivz.config.ts
//   - ulivzrc.js
//   - ulivzrc.ts
const config = loadConfig({
  configKey: 'ulivz',
});

Custom config path:

// This will load `ulivz.config.test.js` directly:
const config = loadConfig({
  cwd: useScene('config-suffix'),
  configKey: 'ulivz',
  configFile: 'ulivz.config.test.js',
});

Credits

load-config-ts wouldn't exist without the inspirations from following projects:

License

MIT © ULIVZ