How to use the yamljs.YAML.parse 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 kaitai-io / kaitai_struct_webide / src / worker / KaitaiWorkerV2.ts View on Github external
public async compile(ksyCode: string) {
        this.ksyCode = ksyCode;
        this.ksy = YAML.parse(ksyCode);

        var releaseCode = await this.compiler.compile("javascript", this.ksy, null, false);
        var debugCode = await this.compiler.compile("javascript", this.ksy, null, true);
        var debugCodeAll = this.jsCode = Object.values(debugCode).join("\n");

        this.classes = {};

        var self = this;
        function define(name: string, deps: string[], callback: () => any) {
            self.classes[name] = callback();
            self.mainClassName = name;
        }
        define["amd"] = true;

        eval(debugCodeAll);
        console.log("compileKsy", this.mainClassName, this.classes);

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 7 years ago

Package Health Score

64 / 100
Full package analysis