1.0.0-alpha.8 • Published 3 years ago

@flatbread/config v1.0.0-alpha.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@flatbread/config 📐

Provides a typed config helper function, config validation, and auto-config retrieval.

💾 Install

Use pnpm, npm, or yarn:

pnpm i @flatbread/config

👩‍🍳 Typical Usage

defineConfig(config)

Provides assistance to your IDE for building your config

// flatbread.config.js
import defineConfig from '@flatbread/config';

export default defineConfig({
  ...
});

😳 Advanced Usage

If you're building something custom, piecemealed from these modules, you can make use of schema validation & config auto-loading.

async loadConfig(...)

Pulls the user config from an optionally specified filepath. By default, this will search the current working directory.

options

  • Type: {cwd?: string | undefined;}
  • Default: {}

Options for loading the config file, defaults to {}. Can pass in cwd as a path string to override the current working directory.

validateConfigHasExports(config)

Validate that the user config has a default export that is an object.

validateConfigStructure(config)

Validate that the user config has source and content properties.

1.0.0-alpha.7

3 years ago

1.0.0-alpha.6

3 years ago

1.0.0-alpha.5

3 years ago

1.0.0-alpha.4

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha.8

3 years ago

1.0.0-alpha.0

4 years ago

0.0.2

4 years ago