# inline-tailwind-emails

> An inliner for Email templates written with HTML and Tailwind CSS

Latest version **1.0.0** (published 2021-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install inline-tailwind-emails
pnpm add inline-tailwind-emails
yarn add inline-tailwind-emails
bun add inline-tailwind-emails
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-11-20 |
| First published | 2021-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 20.1 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | mykeels |
| Maintainers | mykeels |

## Links

- npm: https://www.npmjs.com/package/inline-tailwind-emails
- Repository: https://github.com/mykeels/inline-tailwind-emails
- Homepage: https://github.com/mykeels/inline-tailwind-emails#readme
- Issues: https://github.com/mykeels/inline-tailwind-emails/issues
- npm.io page: https://npm.io/package/inline-tailwind-emails

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^0.24.0
- [prettier](https://npm.io/package/prettier.md) ^1.19.1
- [inline-css](https://npm.io/package/inline-css.md) ^3.0.0
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.26.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.17.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^6.7.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^3.1.2

## Recent versions

- 1.0.0 (latest) — 2021-11-20

## README

## Inline Tailwind Emails

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

### Usage

```sh
npm i inline-tailwind-emails
```

and inline a single file with:

```js
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:

```js
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>",
 *   }
 * ]
 * 
 */
```

---
_Source: https://npm.io/package/inline-tailwind-emails · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
