@sharoussh/html-email-builder
v1.0.0
Published
Zero-dependency CLI to build responsive HTML emails from JSON
Maintainers
Readme
html-email-builder
Zero-dependency CLI to build responsive HTML emails from a simple JSON config. No templates, no frameworks — just clean table-based HTML that works in all email clients.
Install
npm install -g html-email-builderOr run without installing:
npx html-email-builder --init
npx html-email-builder email.jsonQuick start
# 1. Create a sample template
email-build --init
# 2. Build the email
email-build email.json
# Output: email.html ✓Config format
{
"subject": "Welcome to Our App!",
"preheader": "Here's how to get started.",
"blocks": [
{ "type": "header", "text": "Welcome! 🎉", "bg": "#4f46e5" },
{ "type": "text", "content": "Hi,<br>Thanks for signing up!" },
{ "type": "button", "text": "Get Started", "url": "https://example.com" },
{ "type": "divider" },
{ "type": "footer", "text": "© 2026 My App", "unsubscribe": "https://example.com/unsub" }
]
}Block types
header
| Field | Description | Default |
|-------|-------------|---------|
| text | Heading text | — |
| subtitle | Subheading | — |
| bg | Background color | #4f46e5 |
| color | Text color | #ffffff |
| logo | Logo image URL | — |
text
| Field | Description | Default |
|-------|-------------|---------|
| content | HTML content | — |
| size | Font size | 16px |
| color | Text color | #374151 |
button
| Field | Description | Default |
|-------|-------------|---------|
| text | Button label | Click here |
| url | Link URL | # |
| bg | Button color | #4f46e5 |
| align | Alignment | center |
image
| Field | Description |
|-------|-------------|
| src | Image URL |
| alt | Alt text |
| caption | Optional caption |
columns
| Field | Description |
|-------|-------------|
| columns | Array of { title, text, image } |
divider / spacer / footer
Simple utility blocks for spacing and footers.
Options
| Flag | Description |
|------|-------------|
| --init | Create a sample email.json |
| --out=FILE | Custom output filename |
| --help | Show help |
Running tests
npm testLicense
MIT
