@speedy-js/config-loader

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

Usage no npm install needed!

<script type="module">
  import speedyJsConfigLoader from 'https://cdn.skypack.dev/@speedy-js/config-loader';
</script>

README

@speedy-js/config-loader

npm version

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

Install

npm i @speedy-js/config-loader -S

Usage

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

Custom config path:

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

Credits

@speedy-js/config-loader wouldn't exist without the inspirations from following projects:

License

MIT © ULIVZ