gulp-premailer

0.4.0 • Public • Published

gulp-premailer

A gulp module using Premailer to bring CSS styles inline when developing HTML emails.

Prerequisites

gulp-premailer uses the Premailer gem to inline styles, and is required for core functionality.

You can install via RubyGems package management framework for Ruby:

gem install premailer

Or you can add it to your project's Gemfile and run bundle install.

Installation

Installing via npm:

npm install --save-dev gulp-premailer

Usage and Example

gulp-premailer takes in piped streams and outputs the resulting HTML as a stream. This allows you to pipe the result to additional tools or the gulp.dest() function to save in a specified directory. To use gulp-premailer, specify it in a pipe within the project gulpfile:

var gulp = require('gulp');
var premailer = require('gulp-premailer');
 
gulp.task('build', function () {
    gulp.src('*.html')
        .pipe(premailer())
        .pipe(gulp.dest('builds/'));
});

In the example above, any files matched by the gulp.src() glob are processed by Premailer, piped to gulp.dest() and, finally, saved to builds/matched-filename.html.

Contributing

As said previously, this is a learning project based on need for other projects and desire to experiment with node. I welcome all insight, discussion and code suggestions.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.4.0
    1,482
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.4.0
    1,482
  • 0.3.0
    4
  • 0.2.0
    2
  • 0.1.2
    2
  • 0.1.1
    1
  • 0.1.0
    2

Package Sidebar

Install

npm i gulp-premailer

Weekly Downloads

1,034

Version

0.4.0

License

MIT

Last publish

Collaborators

  • justin713