npm Packages
Installation
Use TailMail Engine in your projects
with our CLI tool or Node.js package.
@tailmail/cli
Command-line toolQuick Start (npx)
Global Installation
Project Installation
Options
-o, --output Output file path (default: output.html) --minify Minify HTML output --keep-classes Keep class attributes Example
@tailmail/core
Node.js packageInstallation
Basic Usage
import { convertToEmail } from '@tailmail/core';
const result = convertToEmail({
html: '<div class="bg-blue-500 p-8">Hello</div>',
css: '.bg-blue-500 { background-color: #3B82F6; } .p-8 { padding: 2rem; }',
minify: false
});
if (result.success) {
console.log(result.html);
// <div style="background-color:#3B82F6;padding:2rem">Hello</div>
} API Options
html (string, required) HTML content with Tailwind classes css (string, required) CSS definitions for the classes minify (boolean, optional) Minify the output HTML Features
- ✓ Inlines all CSS styles
- ✓ Removes class attributes
- ✓ Optimizes duplicate inline styles
- ✓ Cleans @import and @theme directives
- ✓ Optional HTML minification
License
Both packages are licensed under AGPL-3.0. You can use, modify, and distribute them freely, but any derivative work must also be open source. If you run a modified version as a web service, you must make your source code available to users.