How to use the parseFile function from yamljs

Find comprehensive JavaScript yamljs.parseFile code examples handpicked from public code repositorys.

41
42
43
44
45
46
47
48
49
50
 * @param {string} filepath 
 */
RoutesManager.prototype.readRoutesFromFile = function(filepath){
    let routes;
    try{
        routes = YAML.parseFile(filepath);
    }catch(e){
        logger.log.error( filepath + " is an invalid Yaml file or have syntax issues.");
        logger.log.error( e);
    }
fork icon2
star icon28
watch icon5

1
2
3
4
5
6
7
8
9
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const lodash = require('lodash');
const yamljs = require('yamljs');

let reportUrl = '';
reportUrl = yamljs.parseFile('launcher-config.yaml').reportServer;

// Process env flags from buildkite and appveyor
const isCi = process.env.CI && process.env.CI !== '';
fork icon306
star icon0
watch icon2

9
10
11
12
13
14
15
16
17

for(var i in config_mapping.requests){
    var req_mapping = config_mapping.requests[i];
    var mappings;
    try{
        mappings = YAML.parseFile(req_mapping);
    }catch(e){
        logger.info(color("Problem in loading " + req_mapping, 'Red'))
    }
fork icon13
star icon0
watch icon1

21
22
23
24
25
26
27
28
29
  return;
}

logger.info(`Provisioning networks from ${NETWORK_PROVISIONING_FILE}`);

const networks = yamljs.parseFile(NETWORK_PROVISIONING_FILE).networks;

let existingNetworks = await getNetworkList();
existingNetworks = new Set(existingNetworks.map(network => network.name));
fork icon11
star icon11
watch icon15