Reading json or toml files.
const jtomler = require('jtomler');
const file_body = `message: "hello yml"
array:
- "array_key1"
- "array_key1"
- "\\\${YML_KEY_TEST}"
object:
val1: "val1-key"
val2: "val2-key"
test: "\${YML_KEY_TEST}"`
const yml_config = jtomler.parse(file_body);
const json_config = jtomler.parseFileSync('config.json');
const toml_config = await jtomler.parseFile('config.toml');
Parsing object from string.
params:
- content - Content for parsing
- env_flag - Flag for parsing environment keys.
Parsing object from file.
params:
- file_path - Path to file.
- env_flag - Flag for parsing environment keys.
Parsing object from file.
params:
- file_path - Path to file.
- env_flag - Flag for parsing environment keys.