1.1.7 • Published 4 months ago

@eljs/config v1.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@eljs/config

Load your config file.

Installation

$ pnpm add @eljs/config
// or
$ yarn add @eljs/config
// ro
$ npm i @eljs/config -S

Usage

import { ConfigManager } from '@eljs/config'

const configManager = new ConfigManager({
  defaultConfigFiles: ['config.ts', 'config.js'],
})

configManager.getConfig()

API

new ConfigManager(options: ConfigManagerOptions): ConfigManager

Create a config manager instance.

export interface ConfigManagerOptions {
  /**
   * Default config files
   * @example
   * ['config.ts', 'config.js']
   */
  defaultConfigFiles: string[]
  /**
   * Default config file extensions
   * @example
   * ['dev', 'staging'] => ['config.dev.ts', 'config.staging.ts']
   */
  defaultConfigExts?: string[]
  /**
   * Working directory
   * @default process.cwd()
   */
  cwd?: string
}

configManager.getConfig<T extends object>(): Promise<T | null>

Return the config object after the configuration files merged asynchronously.

configManager.getConfigSync<T extends object>(): Promise<T | null>

Return the config object after the configuration files merged synchronously.

1.1.7

4 months ago

1.1.6

4 months ago

1.1.5

5 months ago

1.1.4

5 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

7 months ago

1.0.0

7 months ago

1.0.0-next.11

7 months ago

1.0.0-next.10

7 months ago

1.0.0-next.9

7 months ago

1.0.0-next.8

7 months ago

1.0.0-next.7

7 months ago

1.0.0-next.6

7 months ago

1.0.0-next.5

7 months ago

1.0.0-next.4

7 months ago

1.0.0-next.3

7 months ago

1.0.0-next.2

7 months ago

1.0.0-next.1

7 months ago

1.0.0-next.0

7 months ago

1.0.0-beta.10

7 months ago

1.0.0-beta.9

7 months ago

1.0.0-beta.8

7 months ago

1.0.0-beta.7

7 months ago

1.0.0-beta.6

7 months ago

1.0.0-beta.5

7 months ago

1.0.0-beta.4

7 months ago

1.0.0-beta.3

7 months ago

1.0.0-beta.2

7 months ago

1.0.0-beta.1

7 months ago

1.0.0-beta.0

7 months ago

0.33.3

7 months ago

0.33.2

7 months ago

0.33.1

7 months ago

0.33.0

7 months ago