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

glob-url

v0.1.1

Published

A dead-basic, dead-simple pattern matcher library for route URLs

Downloads

10

Readme

Glob Url

Glob Url is a dead-basic, dead-simple pattern matcher library for route URLs.

Installation

With pnpm

pnpm add glob-url

...with npm

npm install glob-url

...or yarn

yarn add glob-url

Usage

Simply import and match away

import { matcher } from 'glob-url';

matcher.match('PATTERN', 'ROUTE');
// or
matcher.test('PATTERN', 'ROUTE');
// both of them do the same thing, choose your poison

The functions return true if ROUTE matches PATTERN.

Pattern Syntax:

  • matching is case-insensitive
  • * matches all characters until the next /, except it is at the end of the pattern, then it matches (literally) everything.

Examples

  • /user/* — will match anything after user/ including /user/peter/pets/etc
  • /user/John — will only match /user/John
  • /user/*/pets — will match /user/John/pets, /user/Ann/pets
  • /*/dashboard — will match /blue/dashboard, /green/dashboard, etc...

Route (Path) Syntax:

  • Routes may or may not have a leading or trailing slash
  • Only forward slash (/) is valid. Please.
  • Examples:
    • /while/you-are/here
    • /star/the/repo
    • /please/
    • /

Contributions

Contributions to glob-url are welcome! I know I said "dead-simple", but if you have an idea for a new feature or have found a bug, please open an issue or submit a pull request.

Author

Hi, I'm ML. I'm trying to break into open-source by creating really awesome 10x developer tools (like this one). By using this tool, you're automagically a 10x developer, 20x if you were 10x before. Give it a star on GitHub to gain another 10x!

Acknowledgements

License

MIT License © 2022 ML