Transform qualifying scenarios into marketing-ready use cases with: - AI-generated titles, descriptions, ROI estimates, business value - Persona/industry/category taxonomy for targeting - Browseable feed with filtering and ranking - SEO-optimized case study pages - Daily cron job for generation and ranking Database: - Add Persona, Industry, Category lookup tables - Add UseCase model with marketing content fields - Add junction tables for personas/industries/categories - Add SocialProof model for cached metrics API: - GET /api/use-cases - Global directory with filtering - GET /api/use-cases/[id] - Individual use case details - GET /api/public/users/[username]/collections/[slug]/use-cases - POST /api/cron/use-cases - Nightly generation job Frontend: - /use-cases - Global feed with persona dropdown - /use-cases/[slug] - SEO case study page - /[username]/collections/[slug]/use-cases - Collection feed - UseCasesFeed component - Sortable table component - UseCaseCaseStudy component - Full case study layout |
||
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsup.config.ts | ||
@tpmjs/tools-template-render
Render mustache-style templates with variable tracking.
Installation
npm install @tpmjs/tools-template-render
Usage
import { templateRenderTool } from '@tpmjs/tools-template-render';
const result = await templateRenderTool.execute({
template: 'Hello {{name}}! Your score is {{score}}.',
data: {
name: 'Alice',
score: 95,
unused: 'extra data'
}
});
console.log(result.rendered);
// => "Hello Alice! Your score is 95."
console.log(result.variablesUsed);
// => ["name", "score"]
console.log(result.unusedVariables);
// => ["unused"]
Options
// Disable HTML escaping
const result = await templateRenderTool.execute({
template: 'Content: {{html}}',
data: { html: '<strong>Bold</strong>' },
options: { escape: false }
});
Features
- Mustache syntax: Uses standard
{{variable}}placeholders - Variable tracking: Reports which variables were used and which were provided but unused
- HTML escaping: Automatically escapes HTML by default (can be disabled)
- Nested data: Supports nested object access with dot notation
License
MIT