prompting-press
v0.3.2
Published
Node.js distribution of Prompting Press — a typed, variant-aware prompt-template library. A thin Zod facade over the Rust napi-rs binding crate (crates/prompting-press-node) and the shared Rust engine.
Downloads
797
Maintainers
Readme
prompting-press
A typed, variant-aware prompt-template library. It turns typed inputs and a template into rendered text plus content-addressed provenance — nothing else (no I/O, no LLM calls, no request assembly). Rust, Python, and TypeScript all bind one compiled Rust engine, so rendered output is byte-identical across every language.
This is the TypeScript distribution: a Zod facade over a napi-rs binding to that engine.
Install
npm install prompting-press zod
pnpm add prompting-press zod
bun add prompting-press zodzod is a peer dependency (bring your own).
Quick start
import { z } from "zod";
import { Prompt } from "prompting-press";
const Vars = z.object({ company: z.string(), max_words: z.number().int() });
const assistant = Prompt.fromYaml(`
name: assistant
role: system
body: "You are a support assistant for {{ company }}. Keep your replies under {{ max_words }} words."
variables:
company: { type: string, trusted: true }
max_words: { type: integer, trusted: true }
`);
const r = assistant.render(Vars, { company: "Acme Robotics", max_words: 50 });
r.text; // "You are a support assistant for Acme Robotics. Keep your replies under 50 words."
r.templateHash; // 64-char SHA-256 of the template source
r.renderHash; // 64-char SHA-256 of the rendered outputDocumentation
Full docs — getting started, API reference, template features, guides, and the CI agreement lint — are at https://prompting-press.github.io/.
