{"id":26177,"library":"refal","title":"refal","description":"REFAL Transpiler to JavaScript is a tool that converts REFAL, a functional programming language with pattern matching, into JavaScript. Version 1.0.0 provides a command-line interface and programmatic API. Unlike general transpilers, it is specialized for REFAL and aims to make REFAL accessible in JavaScript environments. The project is minimal and early stage, with no regular release cadence.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","refal","transpiler","compiler"],"install":[{"cmd":"npm install refal","lang":"bash","label":"npm"},{"cmd":"yarn add refal","lang":"bash","label":"yarn"},{"cmd":"pnpm add refal","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is not published on npm and must be required locally.","wrong":"import { transpile } from 'refal';","symbol":"transpile","correct":"const { transpile } = require('./src/index.js');"},{"note":"Export is named, not default.","wrong":"const transpile = require('./src/index.js');","symbol":"transpile","correct":"const { transpile } = require('./src/index.js');"},{"note":"If using default import, it fails because no default export.","wrong":"const transpile = require('./src/index.js'); transpile(refalCode);","symbol":"transpile (default)","correct":"const transpile = require('./src/index.js').transpile;"}],"quickstart":{"code":"const { transpile } = require('./src/index.js');\nconst refalCode = `\n$ENTRY Go {\n  = <Hello>;\n}\n\nHello {\n  = 'Hello, World!';\n}\n`;\nconst jsCode = transpile(refalCode);\nconsole.log(jsCode);","lang":"javascript","description":"Transpiles a simple REFAL program that prints Hello World to JavaScript and logs the result."},"warnings":[{"fix":"Install from source or copy the src directory.","message":"The package is not published on npm; usage requires local file path.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"Use require() instead of import.","message":"No CommonJS vs ESM distinction; all code is CommonJS.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"Run from project root or adjust path.","message":"The CLI script requires local execution via node bin/refal.js.","severity":"gotcha","affected_versions":"1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use a local path require instead.","cause":"Attempting to import from an npm registry that does not have the package.","error":"Error: Cannot find module 'refal'"},{"fix":"Use const { transpile } = require('./src/index.js');","cause":"Importing the whole module as a function instead of destructuring the named export.","error":"TypeError: transpile is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}