Official JavaScript/TypeScript compiler for PromptL, a language for defining dynamic LLM prompts with variables and control flow. Current version 0.12.0, actively developed by Latitude. Ships TypeScript types natively. Compiles PromptL syntax into structured JSON messages compatible with major LLM providers like OpenAI. Unlike raw template strings, PromptL provides a validated grammar, front-matter for model config, and built-in support for multi-turn conversations. Release cadence is weekly to bi-weekly. Key differentiator: human-readable prompt files with dynamic logic, compiled to provider-native formats without runtime dependencies.
npm install promptl-aiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles a PromptL string with variables into a provider-ready JSON object, showing variable interpolation and front-matter parsing.
Access result.messages for the message array and result.config for model/temperature/etc.
Replace { strict: true } with { mode: 'strict' }.Ensure all variables %7B%7B varName }} are provided in the options.variables object, or set mode to 'loose' to ignore missing variables.
Upgrade Node.js to version 18 or later.
Add "type": "module" to your package.json or use dynamic import: await import('promptl-ai')Use `import { compile } from 'promptl-ai'` instead of `import compile from 'promptl-ai'`Pass all required variables during compilation: compile(template, { variables: { country: 'France' } })No dependency data recorded yet.