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

@researchgate/emailonacid-snapshot

v4.0.4

Published

Mails visual regression tooling via Email on Acid service

Downloads

42

Readme

emailonacid-snapshot

Mail Visual Regression library based on Email on Acid API service.

Quick Start

  1. Install @researchgate/emailonacid-snapshot package as devDependency:
# yarn
yarn add --dev @researchgate/emailonacid-snapshot

# npm
npm install --save-dev @researchgate/emailonacid-snapshot
  1. Define process.env.EOA_API_KEY and process.env.EOA_ACCOUNT_PASSWORD API credentials.

  2. Use createEmail with your favorite test runner:

const { createEmail } = require('@researchgate/emailonacid-snapshot');

async function run() {
  const email = await createEmail('<html><!-- static markup --></html>');
  const screenshot = await email.screenshot('outlook07');
  // assert screenshot at this point
  await email.clean();
}

run();

Check options docs and examples for futher setup.

Options

You can provide config with either one of package.json#emailonacid, emailonacid.config.js, and .emailonacidrc.json.

Note: clients and plugins options are not merged but overridden.

  • clients <?Array<string>> List of default clients to create tests with.
  • credentials <Object>
    • apiKey <string> EoA API key. Defaults to process.env.EOA_API_KEY.
    • accountPassword EoA API password. Defaults to process.env.EOA_ACCOUNT_PASSWORD.
  • debug <?boolean> Enables verbose debug logging. Defaults to process.env.DEBUG or process.env.EOA_DEBUG.
  • plugins <?Array<Function>> List of plugins to apply for each test. Default plugins are ThreadBustingPlugin, ContentRendererPlugin, LocalCopyPlugin, ContentCroppingPlugin. If you're willing to implement custom plugin, check one of those plugins for reference.
  • poll <?Object> Polling options
    • interval <number> Polling interval. Defaults to 2.5e3 (2.5 sec).
    • timeout <number> Polling timeout. Defaults to 300e3 (5 min).

API

See TypeScript typings for more API details.

createEmail

import { createEmail } from '@researchgate/emailonacid-snapshot';

Creates new email with default and global options. Returns email instance object.

configureCreateEmail

import { configureCreateEmail } from '@researchgate/emailonacid-snapshot';

Creates new email factory with default, global and provided options. Helpful for creating multiple createEmail functions to defined different set of targets or different renderers.

withDefaultPlugins

import { withDefaultPlugins } from '@researchgate/emailonacid-snapshot/config';

Merges user-provided config with list of default plugins.

withOverridableClients

import { withOverridableClients } from '@researchgate/emailonacid-snapshot/config';

Merges user-provided config with a dynamic list of clients which can be overridden via EOA_CLIENTS environment variable.

License

MIT © ResearchGate