ckParser Transpiler
raw JSON → 2.0.3 verified Fri May 01 auth: no javascript
A transpiler for the Momoko project that converts custom syntax into target code. Current stable version is 2.0.3. The package is tightly coupled with the Momoko ecosystem and offers specialized transformation rules not found in general transpilers. Release cadence is irregular, aligned with Momoko updates. Differentiators include lightweight implementation and direct integration with ckParser grammar.
Common errors
error Error: Cannot find module 'ck-transpiler' ↓
cause Package not installed or missing from node_modules.
fix
Run
npm install ck-transpiler to install the package. error TypeError: transpile is not a function ↓
cause Importing the default export instead of named export.
fix
Use
import { transpile } from 'ck-transpiler' instead of import ckTranspiler from .... Warnings
breaking In v2.0.0, the default export was removed; use named exports instead. ↓
fix Replace `import ckTranspiler from 'ck-transpiler'` with `import { transpile } from 'ck-transpiler'`.
deprecated The `transform` function is deprecated in v2.0.3 and will be removed in v3. ↓
fix Use `transpile` with `{ mode: 'transform' }` option instead.
gotcha The package requires Node.js >=14 due to ESM and top-level await usage. ↓
fix Update Node.js to version 14 or later.
Install
npm install ck-transpiler yarn add ck-transpiler pnpm add ck-transpiler Imports
- default wrong
const ckTranspiler = require('ck-transpiler')correctimport ckTranspiler from 'ck-transpiler' - transpile
import { transpile } from 'ck-transpiler' - parse wrong
import parse from 'ck-transpiler'correctimport { parse } from 'ck-transpiler'
Quickstart
import { transpile } from 'ck-transpiler';
const input = `let x = 1;`;
try {
const output = transpile(input, { target: 'es2020' });
console.log(output.code);
} catch (err) {
console.error('Transpilation failed:', err.message);
}