New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

glob-url

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-url

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

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Glob Url

npm GitHub CI

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

Keywords

FAQs

Package last updated on 23 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc