@jig-lang/jig
v1.0.1
Published
A template engine for code generation. Forked from Edge.js by Harminder Virk.
Downloads
22
Maintainers
Readme
Jig
A template engine purpose-built for code generation. Fork of Edge.
What is Jig?
Jig is a fork of Edge — the template engine behind AdonisJS — purpose-built for code generation. It strips away HTML escaping and HTML-specific helpers, adds implicit indentation control and filter syntax, and keeps everything else that makes Edge great: components, slots, partials, and full JavaScript expressions.
If you know JavaScript, you know Jig. Use familiar control flow (@if, @each, @component), interpolation ({{ }}), and add custom filters for transformations.
Key Differences from Edge
- No HTML escaping —
{{ value }}outputs raw values without any escaping - No HTML helpers —
html.attrs,html.classNames,nl2br, and other HTML-specific utilities are removed - Filter syntax —
{{ mode :: expr }}applies registered filters to expressions - No
safe()function — Unnecessary since all output is raw
Quick Example
Generate TypeScript interfaces from a data structure:
export interface {{ interfaceName }} {
@each(field in fields)
{{ field.name }}: {{ field.type }};
@end
}With data:
{
"interfaceName": "User",
"fields": [
{ "name": "id", "type": "number" },
{ "name": "email", "type": "string" }
]
}Outputs:
export interface User {
id: number;
email: string;
}Installation
Using npm:
npm i jigUsing bun:
bun add jigDocumentation
Full documentation is available at https://jig.saulo.engineer
Built on Edge
Jig is forked from Edge, the template engine created by the AdonisJS team. We thank them for building such a solid foundation.
License
MIT
