Socket
Socket
Sign inDemoInstall

jet-engine

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jet-engine

Jet engine


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

#jet-engine

More complete documentation to follow.

jet-engine is a template engine with syntax very similar to dustjs-linked in. It was written because I needed a template engine that was more compact and less complicated to use than dustjs, but I liked dustjs syntax, compared to other template engines like handlebars. In the few cases in which I wanted templates to behave differently, I implemented my preferred way. I also had no requirement for asynchronous template handing, so I left that out.

Usage

If you know dustjs template syntax, you know jet-engine syntax. Here are some some examples.

import { render } from 'jet-engine';

const out = render('Hello, {name}!', { name: 'World' });    // Hello, World!

All the familiar keywords are implemented,

{#section}
{?test}
{!not}      // also supports {^not} syntax for compatability
{@eq ...}   // and other helpers
{>partials}
{<inline-partials}
{+blocks}
{~gt}       // and other special characters

Partials

Register a partial like this

import { render, register } from 'jet-engine';

register('greet', 'Hello, {name}!')
const out = render('{>greet}', { name: 'Jim' });
const out = render('{>greet name='Jim'}'); // or provide data as an attribute

Many more examples and additional documentation to follow

Keywords

FAQs

Last updated on 16 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc