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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gog-receipts

v1.0.2

Published

A Linux-based Node.js tool and library for automatically downloading and archiving official GOG purchase receipts as PDFs.

Downloads

15

Readme

gog-receipts

GitHub stars GitHub followers

GitHub issues GitHub pull requests Last commit

License Node Linux npm

About

Retrieving official purchase receipts from GOG for tax purposes or digital preservation is a tedious, manual process of navigating order history and printing individual pages.

This Linux-based Node.js tool automates the entire workflow. It logs in, discovers your orders, and archives official GOG receipts as PDFs. It supports usage as a standalone CLI or a library integrated into other projects.

Compatibility

  • Operating system: Linux only. Windows and macOS are not supported.
  • Runtime: Node.js 20+ only. While Node 18+ may happen to work during development, the project targets Node 20 for CI and local development.

Setup

Follow these steps to get the project running locally.

Prerequisites

Installation of dependencies

Use npm ci for a clean, reproducible installation:

npm ci

Install the browser used by Puppeteer

This project uses Puppeteer with Firefox for automating receipt downloads. Install the managed Firefox binary once using the provided script:

npm run browser:install

Usage

1. CLI Usage

Run the CLI with the desired options:

npm run cli -- [options]

Options:

| Option | Alias | Description | Default | |:------------------|:------|:-----------------------------------------------------------------------------------|:-------------------| | --receipts-dir | -d | Output directory for PDFs | receipts | | --no-background | | Do not print CSS backgrounds | false | | --viewport | -v | Viewport size as WIDTHxHEIGHT | 1280x800 | | --wait | -w | WaitUntil event for navigation: load|domcontentloaded|networkidle0|networkidle2 | networkidle0 | | --timeout | -t | Navigation timeout in ms | 60000 | | --headful | | Run browser with UI | false (headless) | | --help | -h | Show help | |

Command Examples

Standard run: Downloads all receipts to the default receipts folder.

npm run cli

Custom output directory: Saves PDFs to a specific folder (e.g., my-docs).

npm run cli -- --receipts-dir ./my-docs

Visible browser (Headful): Runs the browser with the UI visible. Useful for debugging or seeing the process in action.

npm run cli -- --headful

Increased timeout: Sets the navigation timeout to 120 seconds. Helpful for slow internet connections.

npm run cli -- --timeout 120000

Login flow only: Logs in to GOG and saves the token to the config file. Useful for running the script without downloading receipts.

npm run cli -- login

Run tests: Runs the test suite.

npm test

2. Library Usage

You can import the core functions into your own Node.js project like this:

import { loginFlow, saveReceipts } from 'gog-receipts';

// Example usage wrapped in an async function
async function main() {
  // 1. Login (interactive or with code)
  // Returns the token object and saves it to config
  const token = await loginFlow();
    
  // 2. Save receipts
  // Returns an array of saved file paths
  const savedFiles = await saveReceipts({
    receiptsDir: './my-receipts',
    token: token, // Optional if token is already saved in config
    headless: true, // Run browser invisibly (default)
    onProgress: (event) => console.log(event) 
  });
      
  console.log(`Saved ${savedFiles.length} files.`);
}
    
main();

Contact

Issues and pull requests are welcome on GitHub.

Roadmap

  • Secure token storage using system keychain (e.g., keytar).
  • Improve receipt link discovery to use a more robust API-based approach instead of web scraping.
  • Continue download on network errors.
  • Continue download after the process is interrupted (also redownload the last file just in case).