melodyc
TypeScript icon, indicating that this package has built-in type declarations

0.20.0 • Public • Published

Melody Logo

NodeJS bindings for the Melody language compiler

Install

npm install melodyc

or

yarn add melodyc

Usage

const { compiler } = require('melodyc');

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
}

Links

/melodyc/

    Package Sidebar

    Install

    npm i melodyc

    Weekly Downloads

    9

    Version

    0.20.0

    License

    MIT OR Apache-2.0

    Unpacked Size

    183 kB

    Total Files

    5

    Last publish

    Collaborators

    • yoav-lavi