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

@dreipol/dreiguard

v0.9.1

Published

Compare cross browser screenshots for url

Downloads

19

Readme

dreiguard

Compare versions of website across different browsers using browserstack api. This cli app will use the browserstack api to create a screenshot of your site. You'll have to configure multiple environments & browsers. Thos screenshots are the compared to each other.

Note: In order to maintain decent performance only the centered 500px x 500px are compared.

Install

npm i @dreipol/dreiguard -g

Usage

dreiguard compare http://dreipol.ch ./config/index.js --json --cli -p dreipol.ch --slack all

Commands

compare

Run comparison for url with configuration from provided file

dreiguard compare <URL> <FILE> [--json] [--cli] [--project NAME] [--slack MODE] [--quiet]
  • --quiet Suppress console output
  • --json will create a json file in the folder configured in the configfile called {PROJECT}.json.
  • --cli will print a more readable table.
  • --slack [all|diff|whitepage] will print the failing results to slack. The webhook url is configured in the configfile. Only send the selected diff warnings.
  • --project <PROJECTNAME> used for creating screenshots and assign them in browserstack (Used for better search)

Example:

dreiguard compare https://dreipol.ch ./dreiguard/config.js

output

┌────────────────────┬────────────────────┬────────────────────┬────────────────────┬──────────┐
│ Device             │ Browser            │ Comp. Device       │ Comp. Browser      │ Diff     │
├────────────────────┼────────────────────┼────────────────────┼────────────────────┼──────────┤
│ Windows 10         │ Chrome 66.0        │ OS X High Sierra   │ Chrome 66.0        │ 0.113069 │
├────────────────────┼────────────────────┼────────────────────┼────────────────────┼──────────┤
│ OS X High Sierra   │ Chrome 66.0        │ Windows 10         │ Chrome 66.0        │ 0.113069 │
└────────────────────┴────────────────────┴────────────────────┴────────────────────┴──────────┘

init

Setup initial configuration file

dreiguard init <FILE>

Example:

dreiguard init ./dreiguard/config.js

Environment variables

In order not to have some sensitive information in the reporsitories there are a couple of env variables you have to either replace in your project or add them.

  • BROWSERSTACK_USER user used to access browserstack
  • BROWSERSTACK_KEY key used to access browserstack
  • SLACK_WEBHOOK webhook to send slack notifications

For local testing you can create a .env file in the project root and than work with dotenv node module. You can use confg/index.js for testing. There dotenv is already set up

Example .env

BROWSERSTACK_USER=REPLACE
BROWSERSTACK_KEY=REPLACE
SLACK_WEBHOOK=REPLACE

Development

In order not have to compile the typescript code every execution, you can use ts-node.

ts-node ./src/cli/index.ts compare https://dreipol.ch ./config/index.js --project dreipol.ch --json --cli