npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-htmlemail

v0.6.0

Published

HTML Email boilerplate generator for Yeoman

Downloads

15

Readme

generator-htmlemail

A Yeoman generator to create HTML emails with built-in support for SCSS, image optimization, CSS inlining, test email delivery and more.

Based on Marco Solazzi's grunt-email-boilerplate.

Features

Requirements

  • Node.js >= 0.8.11 (install wiki)
  • Yeoman >= 1.0.0 (npm install -g yo)
  • Ruby >= 1.8.7 (installers)
  • Compass >= 0.12.2 (gem install compass)
  • Premailer >= 1.7.3 (gem install premailer and, most of the time, gem install hpricot)

Getting Started

To install generator-htmlemail from npm, run:

$ npm install -g generator-htmlemail

Then, initiate the generator in an empty directory with:

$ yo htmlemail

Documentation

Prompts

This generator will ask you a few questions about your project before scaffolding the file structure. Here's a summary of what each question is used for:

[?] What's the project name?

Used in the generated package.json file as the name of the project, by default this is the folder name.

[?] What template do you want to use?

Enter the URL of the boilerplate HTML file you want to use for your email, this can be the "raw" version of a github file or gist. Defaults to a modified version of HTML Email Boilerplate.

[?] What's your production domain?

Used by the premailer task to rewrite your assets url, e.g:

<img src="/img/sample.jpg" />

Becomes:

<img src="http://www.yourdomain.com/img/sample.jpg" />

[?] Select the SMTP host to use when sending test emails

Used to set up the nodemailer transport service.

[?] What's your SMTP server username and passsword?

Used to authenticate with the SMTP service.

[?] What's the name and email of the test email recipient?

The name and email address of the account where the test email will be sent.

Sources

Sources are located in the app folder:

  • index.html: HTML boilerplate
  • scss/: SCSS folder
    • style.scss: main stylesheet
  • img: source images of your email
  • css: destination folder of compiled SCSS sources

Default Tasks

The generator comes with some predefined tasks to cover average email development needs.

dev Task

This task runs a watch trigger for changes to the scss folder and starts a static HTTP server at http://localhost:8000 pointing to the app folder. The browser will reload automatically (thanks to the livereload task) upon changes to your SCSS or HTML files.

build Task

This task creates a build from your sources. It creates a folder named dist next to app, then compiles your SCSSes and inlines the resulting stylesheet in the HTML source through Premailer. Finally it starts a static HTTP server at http://localhost:8000 pointing to the dist folder.

Images are optimized with jpegtran and OptiPNG.

send Task

This task sends the compiled email to any configured recipient. This basically performs the same actions as the build task only that instead of running a static HTTP server it'll try to send the actual email.

Yeoman will ask you for your email transport settings and recipients on startup but if you wish to further customize these options refer to the nodemailer tasks in Gruntfile.js.

Tasks Customization

See Gruntfile.js source for more options and customizations.

Contributing

Feel free to submit bugs or pull requests, just make sure to target the develop branch and follow the same coding style.

License

MIT License