A Rust-based template compiler for the jinge web framework, currently at version 4.1.9. It uses SWC under the hood to transform jinge templates into optimized JavaScript/TypeScript code. The compiler is distributed as an npm package and supports modern JavaScript features, TypeScript, and reactive template compilation. It is actively maintained with occasional releases as the jinge framework evolves. Key differentiators: written in Rust for performance, tightly integrated with the jinge reactive system, and provides compile-time optimizations like watch/listener generation for nested properties.
npm install jinge-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of the compile function with an inline template string, specifying filename and module mode.
Use import syntax. If you must use require, downgrade to v3.x or use dynamic import().
For v1 usage, use: const compiler = require('jinge-compiler'); const result = compiler.compile(...); For v2+, use import { compile } from 'jinge-compiler'.Replace import { parse } from 'jinge-compiler' with compile(input, { output: 'ast' }).Always normalize paths with path.posix.join() or replace backslashes with forward slashes.
Upgrade Node to at least v14.0.0.
Add "type": "module" to package.json, or rename file to .mjs, or use dynamic import() inside a CommonJS module.
Use import { compile } from 'jinge-compiler' or downgrade to v3.x.Check your jinge-compiler version. For v2+, use import compiler from 'jinge-compiler' (default is compile). For v1, use 'jinge-compiler/compiler'.