{"id":24898,"library":"alamode","title":"ÀLaMode (alamode)","description":"A RegExp-based transpiler for Node.js that converts ES import/export statements to CommonJS require/module.exports and supports JSX, with zero dependencies. Current stable version is 3.7.1, released with irregular cadence. Differentiators: minimal transformation preserving line numbers and original code structure, no interop wrappers, no dependency on Babel or AST, making it lightweight and fast. Suitable for projects that only need simple module transpilation without full ES module semantics.","status":"active","version":"3.7.1","language":"javascript","source_language":"en","source_url":"git://github.com/a-la/alamode","tags":["javascript","alamode","transpiler","transpile","compiler","compile","import","export","exports"],"install":[{"cmd":"npm install alamode","lang":"bash","label":"npm"},{"cmd":"yarn add alamode","lang":"bash","label":"yarn"},{"cmd":"pnpm add alamode","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The library is ESM-only and exports a default transpile function.","wrong":"const alamode = require('alamode')","symbol":"default","correct":"import alamode from 'alamode'"},{"note":"Named export available, but ESM-only.","wrong":"const { transpile } = require('alamode')","symbol":"transpile","correct":"import { transpile } from 'alamode'"},{"note":"When using CommonJS require, default export is assigned to module.exports, so require returns the transpile function directly.","wrong":"import alamode from 'alamode'","symbol":"alamode","correct":"const alamode = require('alamode')"}],"quickstart":{"code":"import alamode from 'alamode';\n\nconst source = `\nimport { join } from 'path';\nexport const greet = (name) => `Hello, ${name}!`;\n`;\n\nconst result = alamode(source);\nconsole.log(result.code);\n// Output:\n// const { join } = require('path');\n// const greet = (name) => `Hello, ${name}!`;\n// module.exports.greet = greet;\n","lang":"javascript","description":"Transpiles a simple ES module with import and export to CommonJS using alamode's default export."},"warnings":[{"fix":"For dynamic imports, use native ESM or a more complete transpiler. For re-exports, rewrite as individual exports.","message":"alamode does not handle dynamic imports (import()) or re-exports (export * from). It only supports static import/export statements.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Explicitly include files via --require with full path or use the CLI for building.","message":"The require hook (--require alamode/register) only affects .js files, not .mjs or .cjs. It also does not transform files in node_modules by default.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Review transpiled JSX output; consider using Babel for complex JSX.","message":"JSX transpilation does not support source maps and may break on complex JSX expressions (e.g., spread attributes, fragments).","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use Node.js >=10 for full support.","message":"The '--harmony' flag or older Node.js versions (<10) may cause syntax errors due to unsupported ES features.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure the file is processed by alamode: use CLI or require hook with correct extension (.js). Check that the source code uses static import/export.","cause":"alamode did not transpile the file (e.g., not using require hook or CLI), or the file is not matched by the require hook pattern.","error":"SyntaxError: unknown keyword export"},{"fix":"Run 'npm install alamode' or 'yarn add alamode'. Ensure node_modules is accessible.","cause":"alamode is not installed or not in the require path.","error":"Cannot find module 'alamode'"},{"fix":"Use 'import alamode from 'alamode'' (default) or 'const alamode = require('alamode').default' (CJS).","cause":"Using wrong import style: default import vs named import.","error":"TypeError: alamode is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}