New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@stll/template-conditions

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stll/template-conditions

A document-template marker and condition engine: {{...}} marker grammar, parse, compute, serialize, field values.

Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
4.7K
-33%
Maintainers
1
Weekly downloads
 
Created
Source

@stll/template-conditions

A document-template marker and condition engine: the {{...}} marker grammar, an expression parser, numeric/arithmetic compute, a condition-builder serializer, and deterministic field-value rendering. Small, side-effect-free functions usable on both backend (Bun) and frontend (browser).

Boolean conditions are evaluated through the canonical @stll/conditions AST and its single evaluator, so template {% if ... %} conditionals share one set of operators and semantics with the rest of the system. This package owns the template surface: the marker grammar, the string parser, the named-condition resolver, the numeric expression evaluator, and the no-code builder serializer.

import { evaluateCondition, scanMarkers } from "@stll/template-conditions";

const branch = evaluateCondition("isCompany and signed", fillData);

for (const marker of scanMarkers(templateText)) {
  // marker.kind, marker.path, ...
}

Install

bun add @stll/template-conditions

Exports (.)

  • Condition evaluation: evaluateCondition, parseCondition, evaluateNumericExpression, serializeCondition, resolvePath.
  • Field values: renderDeterministicFieldValue, renderComposite, formatDate.
  • Marker grammar: scanMarkers, classifyMarker, markerPattern, placeholderPattern, and the directive-kind constants.

License

Apache-2.0

Keywords

condition

FAQs

Package last updated on 08 Sep 2026

Related posts