Socket
Socket
Sign inDemoInstall

html-preflight

Package Overview
Dependencies
89
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    html-preflight

The HTML email preflight process, maximing compression without distortion


Version published
Maintainers
3
Install size
24.6 MB
Created

Readme

Source

html-preflight

Build Status NPM version

HTMLPreflight is a runner of plugins that transform an email before sending it.

Example

var HTMLPreflight = require('html-preflight');
var Minifier = require('html-preflight').MinifierPlugin;

var minifier = new Minifier();
var preflight = new HTMLPreflight([minifier.run.bind(minifier)]);

preflight.run(htmlString, { stats: true }, function(err, finalHtml) {
  console.log(arguments);
});

Documentation

HTMLPreflight(plugins)

Takes in an array of functions. This functions will run in the order they were provided. Each will pass the resulting HTML string to the next function. Always keep in mind that if your provided function must have access to its scope, you will probably have to bind it to it.

run(htmlString, options, callback)

  • htmlString -> Initial HTML to transform.
  • options -> Object with flags for stats.
  • callback(err, html) -> Callback executed after plugins finish running. The second parameter will contain the final transformation

Enjoy

Keywords

FAQs

Last updated on 15 Dec 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc