Skip to main content
Deno 2 is finally here 🎉️
Learn more

Melody

Deno bindings for the Melody language compiler

Usage

import { compiler } from 'https://deno.land/x/melody/melody_wasm.js';

const source = `
  <start>;

  option of "v";

  capture major {
    some of <digit>;
  }

  ".";

  capture minor {
    some of <digit>;
  }

  ".";

  capture patch {
    some of <digit>;
  }

  <end>;
`;

try {
  const output = compiler(source);
  new RegExp(output).test('v1.1.1'); // true
} catch (error) {
  // handle compilation error
}