Bitbox Transpiler

raw JSON →
1.0.25 verified Fri May 01 auth: no javascript

Transform bitbox syntax to JavaScript. Version 1.0.25 is the current stable release. This package is part of the bitboxjs ecosystem and provides a transpiler that converts bitbox template syntax (similar to JSX) into standard JavaScript. It is used to compile .bitbox files into runnable JavaScript code. The library is designed for use with bitbox applications and is typically a build-time dependency. It has no active development cadence and is niche to the bitbox framework.

error Cannot find module 'bitbox-transpiler'
cause Package not installed or not in node_modules.
fix
Run 'npm install bitbox-transpiler' to install it.
error SyntaxError: Unexpected token '<'
cause Code passed to transpile is not valid bitbox syntax.
fix
Ensure input is valid bitbox markup, e.g., '<div>...</div>'.
error 'import' and 'export' may only appear at the top level
cause Using transpile on code that contains import/export statements outside of module scope.
fix
Ensure the input code is a full module or use appropriate transformer options.
gotcha The package might not work with Node.js versions below 12 due to use of modern JavaScript features.
fix Upgrade Node.js to version 12 or higher.
gotcha No TypeScript definitions included; need to install @types/bitbox-transpiler separately.
fix Run 'npm install --save-dev @types/bitbox-transpiler' if using TypeScript.
deprecated The API may change in future versions; no guarantees on breaking changes.
fix Pin specific version and test upgrades carefully.
npm install bitbox-transpiler
yarn add bitbox-transpiler
pnpm add bitbox-transpiler

Transpile bitbox syntax to JavaScript using the default import and basic usage.

import transpile from 'bitbox-transpiler';

const code = '<div>Hello World</div>';
const result = transpile(code);

console.log(result);
// => 'React.createElement("div", null, "Hello World")'