json-config-read

0.0.7 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i json-config-read

Weekly Downloads

0

Version

0.0.7

License

ISC

Unpacked Size

24.8 kB

Total Files

15

Last publish

Collaborators

  • salvatorepreviti