Registry / serialization / idyll-compiler

idyll-compiler

JSON →
library5.0.0-alpha.2jsnpmunverified

Lexer and parser for the Idyll markup language, converting Idyll source into an abstract syntax tree (AST). Current version is 5.0.0-alpha.2, with active development. It allows embedding Idyll documents in web pages when combined with idyll-document. Key differentiators: provides a full AST for custom processing, supports async compilation, and is part of the Idyll ecosystem. It is ESM-only and requires Node.js 12+.

npm install idyll-compiler
INSTALL
IMPORT
SIG · IDYLL-COMPILER
I
idyll-compiler
serializationjavascriptv5.0.0-alpha.2
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.

compile
import { compile } from 'idyll-compiler'
const compile = require('idyll-compiler')
ESM-only; CommonJS require will fail. Use the named export.
preprocess
import { preprocess } from 'idyll-compiler'
Available if you need to preprocess Idyll source before full compilation.
default export
import idyllCompiler from 'idyll-compiler'
import { default } from 'idyll-compiler'
The module has a default export that is the compile function. Prefer named import for clarity.

Compiles a simple Idyll string with variable and inline element into an AST, then logs it.

import { compile } from 'idyll-compiler'; const input = `[var name:"World"]\nHello [span]${name}[/span]!`; compile(input, { async: false }).then(ast => { console.log(JSON.stringify(ast, null, 2)); }).catch(err => { console.error(err); });
idyll --version
Debug
Known issues
breakingv5 changed from CJS to ESM only.
fix
Use import syntax and ensure your project supports ESM ("type": "module" in package.json).
affects: >=5.0.0-alpha
deprecatedcompile callback style removed in v5; use Promise-based API.
fix
Use .then/catch or async/await instead of callback.
affects: >=5.0.0-alpha
gotchaFor browser usage, compile runs synchronously if options.async is false.
fix
Set { async: false } to avoid Webpack issues with dynamic imports.
affects: *
Errors
Common errors & fixes
SyntaxError: Unexpected token
Idyll syntax error in input string (e.g., mismatched tags).
fix
Validate your Idyll syntax. Use an Idyll linter or check brackets.
compiler is not a function
Importing the package incorrectly (CJS vs ESM).
fix
Use `import { compile } from 'idyll-compiler'`.
Cannot find module 'idyll-compiler'
Package not installed or incorrect version.
fix
Run `npm install idyll-compiler` and ensure it's in dependencies.
Upgrade
Version history
5.0.0-alpha.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
idyll-compiler — npm install idyll-compiler · libregistry