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

publix-coupon-clipper

v4.0.0

Published

Automatically clip Publix digital coupons

Downloads

32

Readme

publix-coupon-clipper

Build Status npm latest version

Publix is a grocery chain that operates throughout the Southeastern United States. This script uses Puppeteer to automatically clip digital coupons which can then be applied to your purchases in store if you provide your phone number at checkout.

Command-line Usage

npx publix-coupon-clipper [email] [password]

If you do not provide your Publix.com email address and password the script will check the PUBLIX_EMAIL and PUBLIX_PASSWORD environment variables. If either of these are missing, you will be prompted for the value to use.

When running npx publix-coupon-clipper the Puppeteer library will download Chromium each time (a >130Mb download as of writing).

To avoid this you can set the PUPPETEER_DOWNLOAD_PATH environment variable to reuse the same download each time. For example:

PUPPETEER_DOWNLOAD_PATH=/tmp/.publix-coupon-clipper-chromium npx publix-coupon-clipper

Alternatively you can set the PUPPETEER_SKIP_CHROMIUM_DOWNLOAD environment variable to 1 and PUPPETEER_EXECUTABLE_PATH to your existing Chrome install (eg. on macOS '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome').

See the Puppeteer documentation on environment variables for more, but also note that they only guarantee support for their bundled Chromium version.

Package Usage

publix-coupon-clipper can also be installed from NPM and used in your own Node.js script.

const { clipCoupons } = require("publix-coupon-clipper");

(async () => {
  const couponCount = await clipCoupons({
    publixEmail: "[email protected]",
    publixPassword: "letmein",
  });

  console.log(`Coupons clipped: ${couponCount}`);
})();

You can optionally provide your own Puppeteer browser instance to use:

const { clipCoupons } = require("publix-coupon-clipper");
const puppeteer = require("puppeteer");

(async () => {
  const browser = await puppeteer.launch({
    headless: false,
  });

  await clipCoupons({
    publixEmail: "[email protected]",
    publixPassword: "letmein",
    browser,
  });

  // Don’t forget to dispose of your browser!
  await browser.close();
})();

An EventEmitter called events is also exported which provides info messages that are useful for logging progress:

const { clipCoupons, events } = require("publix-coupon-clipper");

(async () => {
  events.on("info", (message) => console.log(new Date(), message));

  await clipCoupons({
    publixEmail: "[email protected]",
    publixPassword: "letmein",
  });
})();

// 2019-07-29T02:52:34.830Z 'Setting up page'
// 2019-07-29T02:52:34.931Z 'Logging in to Publix.com'
// 2019-07-29T02:52:38.807Z 'Logged in successfully'
// 2019-07-29T02:52:38.807Z 'Clipping coupons'
// 2019-07-29T02:52:42.322Z 'Clipping coupon #1'
// 2019-07-29T02:52:43.458Z 'Clipping coupon #2'
// 2019-07-29T02:52:44.587Z 'Clipping coupon #3'
// …
// 2019-07-29T02:52:52.827Z  Clipped 10 coupon(s), failed to clip 0