Registry / serialization / milkdrop-eel-parser

milkdrop-eel-parser

JSON →
library0.0.4jsnpmunverified

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.

npm install milkdrop-eel-parser
INSTALL
IMPORT
SIG · MILKDROP-EEL-PARSE
M
milkdrop-eel-parser
serializationjavascriptv0.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MilkdropEELParser
<!-- In HTML --> <script src="https://unpkg.com/milkdrop-eel-parser/release/md-parser.min.js"></script> <script> const parser = window.MilkdropEELParser; // ... use parser.parseExpression or parser.convertExpression </script>
This library is a ClojureScript compilation output, exposing a global `MilkdropEELParser` object. It is not designed for modern ES module `import` syntax. Direct script inclusion is the intended method for browser environments.
parseExpression
const parsed = window.MilkdropEELParser.parseExpression('x + y');
import { parseExpression } from 'milkdrop-eel-parser';
Access `parseExpression` as a method on the global `MilkdropEELParser` object after the script has loaded. It handles parsing the EEL2 syntax into an intermediate representation.
convertExpression
const converted = window.MilkdropEELParser.convertExpression('x + y');
const convertExpression = require('milkdrop-eel-parser').convertExpression;
Access `convertExpression` as a method on the global `MilkdropEELParser` object. This function takes an EEL2 expression and translates it into an equivalent JavaScript string for execution.

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.

<!-- index.html --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Milkdrop EEL Parser Quickstart</title> </head> <body> <h1>Milkdrop EEL2 Parser Example</h1> <p>Original EEL2 Expression: <code>'x = x + 0.1;'</code></p> <p>Parsed Output (console): <code id="parsedOutput"></code></p> <p>Converted JavaScript (console): <code id="convertedOutput"></code></p> <!-- Load the library via CDN --> <script src="https://unpkg.com/milkdrop-eel-parser/release/md-parser.min.js"></script> <script> if (window.MilkdropEELParser) { const eelExpression = 'x = x + 0.1;'; // Parse the EEL2 expression const parsedAst = window.MilkdropEELParser.parseExpression(eelExpression); document.getElementById('parsedOutput').textContent = 'Check console for AST'; console.log('Parsed AST:', parsedAst); // Convert the EEL2 expression to JavaScript const jsFunctionString = window.MilkdropEELParser.convertExpression(eelExpression); document.getElementById('convertedOutput').textContent = jsFunctionString; console.log('Converted JavaScript function string:', jsFunctionString); // Example of executing the converted JS (for demonstration, be careful with eval in prod) // Note: `x` would typically be part of a larger state object in a real visualizer let x = 0; const fn = new Function('x', 'return (' + jsFunctionString + ');'); console.log('Initial x:', x); for (let i = 0; i < 5; i++) { x = fn(x); console.log(`x after iteration ${i + 1}:`, x); } } else { console.error('MilkdropEELParser not found. Is the script loaded correctly?'); } </script> </body> </html>
Debug
Known issues
gotchaThis library is a ClojureScript compilation output and does not offer standard ES module (`import`) or CommonJS (`require`) exports. It exposes a global `window.MilkdropEELParser` object, requiring direct script inclusion in HTML.
fix
Use a `<script>` tag to load `md-parser.min.js` (e.g., from unpkg) and access `window.MilkdropEELParser`.
affects: >=0.0.1
breakingThe package version `0.0.4` indicates a very early development stage. While no formal breaking changes are documented, minor versions in this range often introduce API changes without adherence to strict semantic versioning.
fix
Always pin to an exact version (e.g., `0.0.4`) if using this library in a build process, and thoroughly test upgrades.
affects: >=0.0.1
gotchaThe project repository shows no significant commits in the last 7-8 years, implying it is largely unmaintained. Users should be aware that bug fixes, feature requests, or compatibility updates are unlikely.
fix
Consider forking the repository if active development or long-term maintenance is required for your project.
affects: >=0.0.1
gotchaThe `convertExpression` function generates a JavaScript string. Executing this string directly (e.g., with `eval` or `new Function()`) can pose security risks if the EEL2 input is untrusted or malformed. Ensure all EEL2 expressions are sanitized.
fix
Only convert and execute EEL2 expressions from trusted sources. Implement robust input validation and sanitization for any user-provided EEL2 code.
affects: >=0.0.1
Errors
Common errors & fixes
ReferenceError: MilkdropEELParser is not defined
The `milkdrop-eel-parser` library was not loaded via a script tag, or the script tag was placed incorrectly (e.g., after attempting to use the object).
fix
Ensure the `<script src="https://unpkg.com/milkdrop-eel-parser/release/md-parser.min.js"></script>` tag is included in your HTML before any code attempts to access `window.MilkdropEELParser`.
Error: Must pass an expression string to parseExpression.
The `parseExpression` or `convertExpression` function was called without a string argument, or with a non-string argument.
fix
Always pass a valid EEL2 expression as a string to the parsing and conversion functions, e.g., `window.MilkdropEELParser.parseExpression('vol = 0.5;')`.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
milkdrop-eel-parser — npm install milkdrop-eel-parser · libregistry