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

html-preflight

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-preflight

The HTML email preflight process, maximing compression without distortion

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

preflight

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

Example

var Preflight = require('preflight');
var Minifier = require('preflight') .MinifierPlugin;

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


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

Documentation

Preflight(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

Package last updated on 17 Apr 2015

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