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

posthog-url-regex-plugin

v1.0.1

Published

A PostHog plugin to regex url strings in your application to remove strings such as UIDs.

Downloads

7

Readme

PostHog URL Regex Plugin

npm_package License: MIT

A PostHog plugin to apply regex expressions to your urls, which allows you to perform parses easier, etc. This is especially suitable for content management websites/apps which have predefined patterns for url categorization.

Using Regexed URLs will allow you to gain better insights from your url data, specific to your categorization needs. This plugin can be used as a preprocessing step for your data, before you use PostHog Cloud or any external database.

Example

  • https://www.bbc.com/news/world-us-canada-62986812
  • $regexed_url: https://www.bbc.com/news/world-us-canada-NEWS

PostHog is the first open-source analytics platform, especially designed for startups and developers. PostHog allows users to use their tools either on the managed PostHog Cloud, or the self-hosted version. Try it out and show your support!

Join the PH Slack community.

Get started

Configure the plugin by entering your parameters for the regexPattern, regexFlag, replacement and mergeFlag.

  • regexPattern is a self-explanatory required string that has to be passed with your config. Strings not
    following regex-valid patterns will not show an error - they will pass the same value unchanged.
  • regexFlag is a self-explanatory required string that has to be passed with your config. The default flag is global (g).
  • replacement is an optional string that can be passed with your config to substitute values in the regex operation. The default value for this is @@@@@ (no reason in particular)
  • mergeFlag is a boolean flag value that has to be passed with your config, and determines whether the regexed output changes will be merged into the properties.$current_url field, else it creates a new column properties$regexed_url field

Helpful Tip!

Always test out your desired regex expressions elsewhere before using this plugin, else you might get some nasty, unwanted results!! I had 99 problems before I used Regex to solve them - now I have 100 problems. I personally used Regexr and Regex101

Developing Locally

To develop this plugin locally, first clone it and then run specs. Please make sure you've got Node and Yarn (recommended) or npm installed.

  • git clone https://github.com/clockworkscorpion/posthog-url-regex-plugin.git
  • yarn install
  • yarn test --watch

Installation

You have three options to install this plugin

  1. Open PostHog Cloud -> Apps -> Installed Apps -> URL Regex Plugin
  2. Install from Github or Gitlab using this repository's URL
  3. Install using npm with the url from npmjs.com

Roadmap

This plugin was created as a starter project, so feel free to contribute, start a discussion or leave an issue if there are features you'd like to see added. For most purposes, it can be considered to be feature complete.

Contributing

Contributions of code, issues, reviews and documentation are always welcome! This is my first Github-based Open Source contribution, as well as one of my first TypeScript projects. All feedback is welcome!