1.0.0-alpha.8 • Published 2 years ago

@flatbread/config v1.0.0-alpha.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

1.0.0-alpha.6

2 years ago

1.0.0-alpha.5

2 years ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

1.0.0-alpha.8

2 years ago

1.0.0-alpha.0

2 years ago

0.0.2

2 years ago