GitShow/sindresorhus/pupa
sindresorhus

pupa

Simple micro templating

by sindresorhus
interpolationnpm-packageplaceholderstringtemplate-template-enginetemplate-librarytemplating
Star on GitHubForknpm

JavaScript

372 stars21 forks6 contributorsQuiet · 11mo agoSince 2017v3.3.0MIT

Meet the team

See all 6 on GitHub →
sindresorhus
sindresorhus27 contributions
apsknight
apsknight1 contribution
BendingBender
BendingBender1 contribution
peteruithoven
peteruithoven1 contribution
Richienb
Richienb1 contribution
yuhr
yuhr1 contribution

Languages

View on GitHub →
JavaScript97.3%
TypeScript2.7%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
henhal
How to escape literal { } sequences that aren't placeholdersClosedIssue

If a text has placeholders, but also substrings that match the placeholder pattern (e.g. ) but should not be substituted but remain as literals, how do I escape them so that they're not interpreted as placeholders? Is the only way to actually perform substitution with the literal itself, i.e. or is there a way to escape placeholder tokens?

henhal · 11mo ago
tommy-mitchell
Support filtersClosedIssue

Many templating languages support filtering individual interpolated values: supports transforming all values, but not individual ones. The regex to match items could be modified to: This would match an arbitrary number of filters separated by . (regex101) Filters would just be an object of functions passed to and would be applied in order from left to right. Filters in the template without a match could have the same semantics as a missing value (either get ignored or throw, perhaps with a new ). Related, some further improvements to the regex could be supporting arbitrary whitespace and characters:

tommy-mitchell · 11mo ago
nghieptiki
Escape dot characterClosedIssue

Hi guys, Sometimes, my data is an object that includes a character. Maybe should be supported character to escape the character.

nghieptiki · 11mo ago
Structured data for AI agents

Repository: sindresorhus/pupa. Description: Simple micro templating Stars: 372, Forks: 21. Primary language: JavaScript. Languages: JavaScript (97.3%), TypeScript (2.7%). License: MIT. Topics: interpolation, npm-package, placeholder, string, template-, template-engine, template-library, templating. Latest release: v3.3.0 (11mo ago). Open PRs: 0, open issues: 0. Last activity: 11mo ago. Community health: 85%. Top contributors: sindresorhus, apsknight, BendingBender, peteruithoven, Richienb, yuhr.

·@ofershap

Replace github.com with gitshow.dev