Registry / serialization / bobe
library0.0.47jsnpmunverified

Bobe is a template runtime compiler that parses a custom indentation-based template syntax into an AST. Current stable version is 0.0.47. It is a niche, experimental tool for generating structured node trees from a compact DSL, with typed output. Unlike general-purpose template engines like Handlebars or EJS, Bobe focuses on a unique indentation-aware syntax with key-value attributes and nested children.

npm install bobe
INSTALL
IMPORT
SIG · BOBE
B
bobe
serializationjavascriptv0.0.47
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Compiler
import { Compiler } from 'bobe'
import Bobe from 'bobe'
Compiler is a named export, not default.
compile
import { compile } from 'bobe'
const compile = require('bobe').compile
ESM-only; CommonJS require may not work as expected.

Parses a sample template string into an AST using the Bobe compiler.

import { Compiler } from 'bobe'; const template = ` node1 k1=1 node1_1 k2=2 k3=3 node2 | p1=1 | p2=2 p3=3 node2_1 | p4=4 p5=5 p6=6 `; const compiler = new Compiler(template); const ast = compiler.program(); console.log(JSON.stringify(ast, null, 2));
Debug
Known issues
gotchaThe template syntax requires proper indentation with spaces; tabs may not be supported.
fix
Use spaces for indentation consistently.
affects: >=0.0.0
breakingIn v0.0.47, the Compiler constructor expects a string, but the program() method may throw if the template is malformed.
fix
Wrap in try-catch or validate template before parsing.
affects: >=0.0.47
gotchaThe '|' pipe prefix is used for props on the same line as a node; forgetting the pipe causes props to be parsed incorrectly.
fix
Ensure that props on a separate line from the node name begin with '|'.
affects: >=0.0.0
Errors
Common errors & fixes
SyntaxError: Unexpected token at line 3: expected indent
Indentation is inconsistent or uses non-space characters.
fix
Use a consistent number of spaces (e.g., 2 spaces per level) and avoid tabs.
TypeError: compiler.program is not a function
Import of Compiler is incorrect (e.g., default import instead of named).
fix
Use `import { Compiler } from 'bobe'`.
Upgrade
Version history
0.0.47latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
bobe — npm install bobe · libregistry