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

0.19.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

Package Sidebar

Install

npm i melodyc

Weekly Downloads

18

Version

0.19.0

License

MIT OR Apache-2.0

Unpacked Size

155 kB

Total Files

5

Last publish

Collaborators

  • yoav-lavi