How to use the yamljs.default.stringify function in yamljs

To help you get started, we’ve selected a few yamljs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zotoio / github-task-manager / src / agent / AgentUtils.js View on Github external
static toYaml(optionsDict) {
        for (let parameter in optionsDict) {
            if (parameter.startsWith('YAML_')) {
                let yamlString = yamljs.stringify(optionsDict[parameter], 8);
                let varName = parameter.replace('YAML_', '');
                optionsDict[varName] = yamlString;
                delete optionsDict[parameter];
            } else {
                if (typeof optionsDict[parameter] == 'object') {
                    optionsDict[parameter] = this.toYaml(optionsDict[parameter]);
                }
            }
        }
        return optionsDict;
    }

yamljs

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

MIT
Latest version published 8 years ago

Package Health Score

64 / 100
Full package analysis