0.0.7 • Published 6 years ago

json-config-read v0.0.7

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

json-config-read

install:

npm i --save json-config-read

API

Table of Contents

ConfigReadOptions

Config read options type

Parameters

allowDirectories

True if directories can be read merging all files inside them

Type: boolean

rootPath

The root path to use. If unspecified, current directory is used.

Type: string

extensions

The file extensions that are parseable.

Type: Object<string, boolean>

default

The default options.

Type: Partial<ConfigReadOptions>

configReadSync

Reads a configuration file or directory synchronously.

Parameters

  • configPath string Path of the file or directory to load
  • options Partial<ConfigReadOptions> The options (optional, default ConfigReadOptions.default)

Returns any The loaded data

configReadAsync

Reads a configuration file or directory asynchronously.

Parameters

  • configPath string Path of the file or directory to load
  • options Partial<ConfigReadOptions> The options (optional, default ConfigReadOptions)

Returns Promise<any> A promise that resolves the loaded data

configsListAsync

Lists all configurations in a directory, asynchrounously.

Parameters

  • folderPath string Path of the folder that contains multiple configurations to list
  • options Partial<ConfigReadOptions> The options (optional, default ConfigReadOptions)

Returns Promise<Array<string>> A promise that resolves a list of full paths

configsListSync

Lists all configurations in a directory, synchrounously.

Parameters

  • folderPath string Path of the folder that contains multiple configurations to list
  • options Partial<ConfigReadOptions> The options (optional, default ConfigReadOptions)

Returns Array<string> A list of all full paths of all configurations

configsReadManyAsync

Reads all the configurations contained in a folder to a map object

Parameters

  • folderPath string Path of the folder that contains multiple configurations to load
  • options Partial<ConfigReadOptions> The options (optional, default ConfigReadOptions)

Returns Promise<Object<string, any>> A promise that resolves a map of loaded configurations

configsReadManySync

Reads all the configurations contained in a folder to a map object

Parameters

  • folderPath string Path of the folder that contains multiple configurations to load
  • options Partial<ConfigReadOptions> The options (optional, default ConfigReadOptions)

Returns Object<string, any> A map of loaded configurations

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago