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

@busy-bee/emails

v4.1.124

Published

This library is for creating reusable, testable components and email templates using React.

Downloads

303

Readme

Overview

This library is for creating reusable, testable components and email templates using React.

Develop

Setup

  1. Open a terminal
  2. Clone git repository
  3. Go into repository dir
  4. Install root dependencies npm install
  5. Start storybook npm run storybook or npm start

Storybook

Check this page to read more about storybook: https://storybook.js.org/

Folder structure

  • .circleci: CircleCI configuration.
  • .storybook: Storybook configuration.
  • src
    • _snapshots_: Snapshot files for test.
    • components: Small components like header, footer, dashboard.
    • customComponents: Email layout components.
    • emailComponents: Rendered HTML email files.
    • emailStrings: String files of rendered HTML emails from emailComponents folder. This is the final result that will be returned.

Dependencies

 

Adding a new email

  1. Create a folder and create a new index.js and stories.js file in EmailComponents folder. If there's any components already created in components folder, use them. Or create your own component. Main style guide and variables are in the /styleGuide.js file.
  2. Once you created email, import it from EmailStrings folder.
  3. Create an test file in the same folder.
  4. Add an export function to src/index.js file.
  5. npm test to check if it's all good.

 

Test

  • Functional test: npm test

 

Publish

  1. npm version major | minor | patch to update version.
  2. git push --tags and then the CircleCI will kindly test, build, and publish the package for you.
  3. If you didn't receive any error message, then hooray! Skull your beer! 🍺

   

Usage

  1. Install npm package via npm: npm install @busy-bee/emails
  2. Import an email rendering function import { stringOfResetPasswordEmail } from @busy-bee/emails
  3. Send appropriate data when you execute a function. Props are mandatory, Options are optional.
  4. If the data/props is appropriate, you'll get a string of rendered email as return. Otherwise, you're get a ruthless error as return.

Test email rendering https://testi.at

Examples

import { stringOfResetPasswordEmail } from @busy-bee/emails;
const props = {
	firstName:  'Caroline',
	passwordToken: 'https://resetpassword.com/'
};

stringOfResetPasswordEmail(props);