{"library":"milkdrop-eel-parser","title":"Milkdrop EEL2 Parser","description":"The `milkdrop-eel-parser` library provides a parser for the Nullsoft/Cockos EEL2 (Expression Evaluation Library 2) scripting language, primarily used in the Milkdrop music visualizer. It is designed to convert EEL2 equations into JavaScript, enabling their use in modern web-based visualizers like Butterchurn. Currently at version `0.0.4`, this project is predominantly written in ClojureScript and compiles to a JavaScript bundle. Its development appears to be in maintenance mode, with no significant updates in the last 7-8 years. Key differentiators include its niche focus on EEL2 parsing and its integration into the broader Butterchurn ecosystem, allowing developers to bring legacy Milkdrop preset logic to the browser environment.","language":"javascript","status":"maintenance","last_verified":"Sun Apr 19","install":{"commands":["npm install milkdrop-eel-parser"],"cli":null},"imports":["<!-- In HTML -->\n<script src=\"https://unpkg.com/milkdrop-eel-parser/release/md-parser.min.js\"></script>\n<script>\n  const parser = window.MilkdropEELParser;\n  // ... use parser.parseExpression or parser.convertExpression\n</script>","const parsed = window.MilkdropEELParser.parseExpression('x + y');","const converted = window.MilkdropEELParser.convertExpression('x + y');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"<!-- index.html -->\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Milkdrop EEL Parser Quickstart</title>\n</head>\n<body>\n  <h1>Milkdrop EEL2 Parser Example</h1>\n  <p>Original EEL2 Expression: <code>'x = x + 0.1;'</code></p>\n  <p>Parsed Output (console): <code id=\"parsedOutput\"></code></p>\n  <p>Converted JavaScript (console): <code id=\"convertedOutput\"></code></p>\n\n  <!-- Load the library via CDN -->\n  <script src=\"https://unpkg.com/milkdrop-eel-parser/release/md-parser.min.js\"></script>\n\n  <script>\n    if (window.MilkdropEELParser) {\n      const eelExpression = 'x = x + 0.1;';\n\n      // Parse the EEL2 expression\n      const parsedAst = window.MilkdropEELParser.parseExpression(eelExpression);\n      document.getElementById('parsedOutput').textContent = 'Check console for AST';\n      console.log('Parsed AST:', parsedAst);\n\n      // Convert the EEL2 expression to JavaScript\n      const jsFunctionString = window.MilkdropEELParser.convertExpression(eelExpression);\n      document.getElementById('convertedOutput').textContent = jsFunctionString;\n      console.log('Converted JavaScript function string:', jsFunctionString);\n\n      // Example of executing the converted JS (for demonstration, be careful with eval in prod)\n      // Note: `x` would typically be part of a larger state object in a real visualizer\n      let x = 0;\n      const fn = new Function('x', 'return (' + jsFunctionString + ');');\n      console.log('Initial x:', x);\n      for (let i = 0; i < 5; i++) {\n        x = fn(x);\n        console.log(`x after iteration ${i + 1}:`, x);\n      }\n\n    } else {\n      console.error('MilkdropEELParser not found. Is the script loaded correctly?');\n    }\n  </script>\n</body>\n</html>","lang":"javascript","description":"This quickstart demonstrates how to include the `milkdrop-eel-parser` in an HTML page via a `<script>` tag and use its global `MilkdropEELParser` object to parse and convert EEL2 expressions into executable JavaScript.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}