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

@tanglemedia/directus-extension-bundle-qr

v0.0.1

Published

A Directus extension bundle that adds a tngl_qr collection and generates print-ready QR code files (SVG + PNG) in brand colors on create. Each QR encodes a fixed site URL (/qr/{uuid}/) that the site redirects to an editable destination.

Downloads

115

Readme

@tanglemedia/directus-extension-bundle-qr

A Directus extension bundle that adds a QR code module into your Directus project. The package will install the following:

  • A collection named tngl_qr
  • A hook that generates a print-ready QR code the moment an item is created:
    • an SVG (vector — professional print) and a 2048 px PNG (general print/download)
    • dark modules use the organization's brand color (tngl_org_branding.primary_color) when it has enough contrast against white (>= 3.0:1), otherwise black
    • both files are uploaded to a "QR Codes" folder in the file library and attached to the item
  • An endpoint POST /tngl-qr/scan/{id} that records each scan as a row in tngl_page_views (page-views bundle)

Each QR code encodes a fixed, deterministic URL the platform controls: ${SITE_BASE_URL}/qr/{uuid}/. The generated image never changes — clients can print and distribute it safely. The destination the page redirects to is a plain editable field (destination_url) and can be changed at any time without reprinting.

It automatically sets the following:

  • Website policy: READ on tngl_qr (so the Hugo build token can pull the collection)
  • Staff policy: CREATE / READ / UPDATE / DELETE on tngl_qr
  • The generated fields (qr_url, qr_svg, qr_png, colors) are locked — updates to them are stripped by a filter hook, at the API level, not just in the UI

Requirements

  • Directus >= 10.10.1
  • Node >= 18.x.x

You should have the following extensions installed:

  • @tanglemedia/directus-core-settings (provides the Website/Staff policies and shared migration helpers)
  • @tanglemedia/directus-extension-bundle-page-views (provides tngl_page_views — scan analytics land there; without it, scans are silently not recorded)
  • directus-extension-display-link (nicer display for the qr_url field)

Install

  1. Add the following variables to your Directus env file:

    • SITE_BASE_URL (public base URL of the site, e.g. https://aurora-ab.ca — baked into every generated QR image)
  2. npm i @tanglemedia/directus-extension-bundle-qr

  3. npx directus bootstrap to update your database and restart directus

Hugo site setup

  1. Add the collection to params.cmsModules in the site's Hugo config:

    - table: tngl_qr
      output: content/qr
      fields: "*"
      limit: -1
      headless: false
  2. Add the layouts/qr/single.html (redirect + scan beacon) and layouts/qr/list.html (stub) templates to the site theme, plus the archetypes/qr.md schema record. See the aurora-2026 site for the reference implementation.

Editorial workflow

  1. Create a QR Code item (name + destination URL). The image generates within a second or two — refresh the item to see it.
  2. Click Publish Site so the /qr/{uuid}/ page goes live.
  3. Only distribute the image after the page is live — scan the PNG yourself first.
  4. Change destination_url whenever needed, then Publish Site again. The printed image keeps working.

Behavioral notes

  • Generation happens once. Later edits (including branding changes) never regenerate existing images.
  • Deliberate escape hatch: delete the two generated files from the file library (the item's file fields go empty), then re-save the item — it regenerates at the current brand color. The encoded URL is the same, so printed codes keep working.
  • Items default to published status so a freshly created QR page goes live on the next build. Archive an item to take its page down (the printed code will then 404 — archive with care).
  • Scan counting is fire-and-forget from the page (navigator.sendBeacon); the endpoint always answers 204 and never blocks the visitor's redirect.