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

email-templates-effe

v1.1.0

Published

A replacement engine for the node module email-templates and should support Foundation for Emails.

Downloads

2

Readme

email-templates-effe

npm version Build Status Coverage Status dependencies Status devDependencies Status license

Email-templates-effe is an alternative engine for email-templates and add support for Foundation for Emails :email::mailbox::rocket:

Dependencies

  • Node.js (requires Angular 6 or higher, tested with v6, v8, v9 and v10)

Installing

install email-templates-effe via npm:

npm install email-templates-effe --save

Or via yarn

yarn add email-templates-effe

Usage

Once installed you need to import the module and set up the root directory for handlebars:

const Email = require('email-templates');
const path = require('path');
const engine = require('email-templates-effe');

// Setup
const email = new Email({
  views: {
    root: path.join(__dirname, 'root/directory/to/all/email/files'),
    options: {
      extension: 'hbs',
      engineSource: engine({
        root: path.join(__dirname, 'handlebars')
      })
    }
  }
});

// Using email engine:
email
  .send({
    template: 'hallo',
    message: {
      to: '[email protected]'
    },
    locals: {
      name: 'John'
    }
  })
  .then(res => {
    console.log('res.originalMessage', res.originalMessage)
  });
  .catch(console.error);

Or you can define all handlebars directory manually with layouts, partials and helpers

// ...Other Code

// Setup
const email = new Email({
  views: {
    root: path.join(__dirname, 'root/directory/to/all/email/files'),
    options: {
      extension: 'hbs',
      engineSource: engine({
        layouts: path.join(__dirname, 'handlebars/layouts'),
        partials: path.join(__dirname, 'handlebars/partials'),
        helpers: path.join(__dirname, 'handlebars/helpers')
      })
    }
  }
});

// ...Other Code

Configuration

| configuration option | type | default | description | |:---------------------|:------:|:-------:|:-----------------------------------------------------------------------------------------------------------------| | root | string | - | With root you can define root directory for handlebars with layouts, partials and partials as suborders. | | layouts | string | - | With layouts you can define an exact handlebars layouts path | | partials | string | - | With partials you can define an exact handlebars partials path | | partials | string | - | With partials you can define an exact handlebars partials path |

Development

For the development you need Node.js v6 or higher. If you have Node.js installed you can use the following commands to run the test

Using npm:

npm install
npm run test:lint // Run lint test in watch
npm run test:watch // Run unit test in watch mode

or use yarn (yarn must be installed since it is not part of node.js.):

yarn install
yarn run test:lint // Run lint test in watch
yarn run test:watch // Run unit test in watch mode

Built With

  • bluebird - Good and fast promise library
  • cheerio - It's like jQuery for Server
  • front-matter - Extract meta data from documents.
  • glob - Match files using the patterns used by the shell
  • handlebars - Handlebars is a template engine
  • inky - Inky is a template engine for Foundation for Emails tags
  • lodash - A helper library
  • strip-bom - Strip UTF-8 byte order mark (BOM) from a string

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Nico Swiatecki - Initial work - Snics

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details