2.0.0 • Published 9 months ago
dallmo-yaml v2.0.0
dallmo-yaml
- a simple config reader based on
fs
andjs-yaml
; - config file assumed to be yaml ;
- ESM-native
- using this in CJS has to be done via dynamic import
usage
cjs
"use strict";
( async()=>{
const dy = await import("dallmo-yaml");
// locate the test config file
const config_file = "./sample-config.yaml";
// test read the config
const config_obj = await dy.dallmo_yaml( config_file );
console.log( config_obj );
})(); // self-run async main
esm
"use strict";
import {dallmo_yaml} from 'dallmo-yaml';
// locate the test config file
const config_file = "./sample-config.yaml";
// test read the config
const config_obj = await dallmo_yaml( config_file );
console.log( config_obj );