Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inline-tailwind-emails

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inline-tailwind-emails

An inliner for Email templates written with HTML and Tailwind CSS

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Inline Tailwind Emails

This tool helps you inline your Email templates that use Tailwind.

Usage

npm i inline-tailwind-emails

and inline a single file with:

const { inlineTailwindEmail } = require("inline-tailwind-emails");

const inlineHtml = await inlineTailwindEmail(
    `
        <link rel="stylesheet" href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css">
        <div class="bg-red-500">
            Hello World!
        </div>
    `,
    {
        url: "https://www.mywebsite.com"
    }
);

or inline multiple files at once with:

const { inlineTailwindEmailFiles } = require("inline-tailwind-emails");

const results = await inlineTailwindEmailFiles(
    [
        "/path/to/file1.html",
        "/path/to/file2.html",
        "/path/to/file3.html"
    ],
    {
        url: "https://www.mywebsite.com"
    }
);
/**
 * results:
 * [
 *   {
 *      "filepath": "/path/to/file1.html",
 *      "html": "<div>...</div>",
 *   },
 *   {
 *      "filepath": "/path/to/file2.html",
 *      "html": "<div>...</div>",
 *   },
 *   {
 *      "filepath": "/path/to/file3.html",
 *      "html": "<div>...</div>",
 *   }
 * ]
 * 
 */

FAQs

Package last updated on 20 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc