email-css
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

email-css

Takes all <link rel="stylesheet"> tags in an HTML document and inlines them as <style> tags.

Useful for automatically inlining CSS in an email.

Usage

Install: npm i email-css

import { linksToStyles } from "email-css";
 
async function example() {
  // can use linksToInline() too
  console.log(await linksToStyles({
    url: "https://google.com"
  }));
  console.log(await linksToStyles({
    html: fs.readFileSync("./example.html", "utf-8"),
    rootUrl: "."
  }));
}

/email-css/

    Package Sidebar

    Install

    npm i email-css

    Weekly Downloads

    0

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    14 kB

    Total Files

    17

    Last publish

    Collaborators

    • aldahick
    • mhoc