Node.js interface to compile Elm 0.19 sources using the official Elm compiler binaries. Current stable version 5.0.6. Provides a programmatic API for compiling Elm files to JavaScript or HTML, finding module dependencies, and reporting compile errors. Key differentiators: wraps the Elm binary, supports sync and async compilation, debug and optimize modes, and respects the elm.json configuration. Notably, requires Elm itself to be installed separately and handles version-specific flags for Elm 0.19.
npm install node-elm-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates async compilation of an Elm source file to a JavaScript string using named import and options object.
Remove 'yes' from options and adapt error handling to use try/catch.
Instead of using 'warn', rely on compiler output; for 'pathToMake', ensure elm binary is on PATH or use the correct path.
Install Elm e.g. via npm: 'npm install -g elm' or have elm on your PATH.
Use import syntax or set "type": "module" in package.json. Consider using dynamic import() as fallback.
Run 'npm install node-elm-compiler' and ensure your package.json includes it.
Switch to import syntax, or update to a legacy version (4.x) if you must use require.
Verify the file path; use absolute paths or ensure relative paths are resolved correctly.
Install Elm globally or specify correct 'pathToMake' option.