Class: KipperConfigFile
A class that represents a Kipper config file.
Since
0.11.0
Hierarchy
-
↳
KipperConfigFile
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• Protected
new KipperConfigFile(content
, fileName?
, encoding?
, meta?
)
Parameters
Name | Type | Default value |
---|---|---|
content |
string |
undefined |
fileName |
string |
"<string>" |
encoding |
BufferEncoding |
"utf8" |
meta? |
ConfigErrorMetaData |
undefined |
Overrides
Defined in
kipper/config/src/kipper-config-file.ts:12
Properties
content
• Readonly
content: string
Inherited from
Defined in
kipper/config/src/abstract/config-file.ts:9
encoding
• Readonly
encoding: BufferEncoding
Inherited from
Defined in
kipper/config/src/abstract/config-file.ts:12
fileName
• Readonly
fileName: string
Inherited from
Defined in
kipper/config/src/abstract/config-file.ts:11
parsedJSON
• Readonly
parsedJSON: Object
Index signature
▪ [key: string
]: any
Inherited from
Defined in
kipper/config/src/abstract/config-file.ts:10
Methods
fromFile
▸ Static
fromFile(file
, encoding
, meta?
): Promise
<KipperConfigFile
>
Create a new KipperConfigFile from a file.
Since
0.11.0
Parameters
Name | Type | Description |
---|---|---|
file |
string |
The file to read. |
encoding |
BufferEncoding |
The encoding of the file. |
meta? |
ConfigErrorMetaData |
The metadata for the error. This is primarily only used when resolving extension files, and does not need to be provided when manually creating a KipperConfigFile. |
Returns
Defined in
kipper/config/src/kipper-config-file.ts:40
fromString
▸ Static
fromString(content
, encoding?
): KipperConfigFile
Create a new KipperConfigFile from a string.
Since
0.11.0
Parameters
Name | Type | Default value | Description |
---|---|---|---|
content |
string |
undefined |
The content of the file. |
encoding |
BufferEncoding |
"utf16le" |
The encoding of the file. As we are running in a JavaScript environment, the default encoding is always assumed to be the internal encoding of the JavaScript environment i.e. UTF-16 (utf16le). |
Returns
Defined in
kipper/config/src/kipper-config-file.ts:28