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

bulletproof-email-creator

v1.3.2

Published

A tool to help create emails that will work on most if not all email clients

Downloads

27

Readme

#Email Builder This application can be used to create email templates using typescript and avoids you from having to deal with legacy html code.

Sample Project: https://github.com/zeeshan595/bulletproof-email-creator-sample

On older clients (Outlook) shadows & border radius may not work for containers/grids. However buttons should have rounded corners.

Sample Code

import {
  IDocument,
  Document,
  IContainer,
  EAlignment,
  Unit,
  Shadow,
  Color,
  IRaw,
  Raw,
  IImage,
  ITemplate,
  Image,
  Text,
  Container,
  IButton,
  Button,
  BorderRadius,
  List
} from "bulletproof-email-creator";

//Create a container
const container = {
  //You MUST import the default settings
  //for this to work properly
  ...Container.Default, //IMPORTANT
  //Container Properties
  Align: EAlignment.Center,
  Width: Unit.Pixels(600),
  Shadow: Shadow.Box(0, 0, 10, 5, Color.rgb(220, 220, 220)),
  BackgroundColor: Color.White,
  BorderRadius: BorderRadius.All(Unit.Pixels(10)),
  Content: [
    //Another container to add left & right margins
    Container.VerticalSpace,
    {
      ...Container.Default,//IMPORTANT
      Align: EAlignment.Center,
      Width: Unit.Percent(90),
      Content: [
        //All text needs to go through
        //IRaw, Raw Template
        {
          ...Raw.Default,//IMPORTANT
          Content: (
            //Text elements can be nested
            Text.p(
              "some amazing text " +
              Text.a("super awesome link", { Hyperlink: "https://google.co.uk" })
            ) + 
            Text.Space + // Add a vertical space
            Text.p(" Some more text ")
          )
        } as IRaw,
        //Container specific vertical space
        Container.VerticalSpace,
        //Image
        {
          ...Image.Default,//IMPORTANT
          Source: "my_cool_image.gif",
          AlternateText: "Cool Image"
        } as IImage,
        //Bulletproof Button
        {
          ...Button.Default//IMPORTANT
          //My Properties for button
        } as IButton,
        {
          ...Container.Default,
          BackgroundImage: "https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500",
          Width: Unit.Pixels(400),
          Content: [
            Container.VerticalSpace,
            Container.VerticalSpace,
            Container.VerticalSpace,
            Container.VerticalSpace,
            Container.VerticalSpace,
            Container.VerticalSpace
          ]
        } as IContainer,
        //List example
        List([
          {
            ...Raw.Default, //IMPORTANT
            Content: (
              Text.p("Hello World")
            )
          } as IRaw,
          {
            ...Raw.Default, //IMPORTANT
            Content: (
              Text.p("Bye World")
            )
          } as IRaw
        ], "numbers", null, 5)
      ] as ITemplate[]
    } as IContainer,
    Container.VerticalSpace
  ] as ITemplate[]
} as IContainer

//Create a html document
const document = {
  ...Document.Default,//IMPORTANT
  BackgroundColor: Color.rgb(240, 240, 240),
  Title: "My Awesome Email",
  Content: [
    //Document specific vertical space
    Document.VerticalSpace,
    container,
    Document.VerticalSpace
  ]
} as IDocument

//save the document
Document.saveDocument(document, "index.html");