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

@bitores/router

v1.0.4

Published

> npm i bitorjs-router

Downloads

9

Readme

bitorjs-router

npm i bitorjs-router

path-to-regexp

pathToRegexp(path, keys?, options?)

path 字符串,字符串数组或正则表达式.
keys 要在路径中找到的键填充的数组.
  name 令牌的名称(string用于命名或number索引)
  prefix (/或.)的前缀字符
  delimiter  的分隔符(与前缀相同/)
  optional 表示令牌是可选的(boolean)
  repeat 表示令牌重复(boolean)
  partial 表示此令牌是部分路径段(boolean)
  patternRegExp 用于匹配此令牌(string)
options
  sensitive 当true 则表达式区分大小写. (default: false) e.g. /one or /One
  strict 当true 严格要求尾随分隔符匹配. (default: false) e.g. /event or /event/
  end 当true 则强制从字符串的结尾匹配. (default: true) 
  start 当true 则强制从字符串的开头匹配. (default: true)
  高级选项(用于非路径名字符串,例如主机名):
    delimiter 默认分隔符. (default: '/')
    endsWith 可选字符或字符列表,用作“结束”字符.
    delimiters 解析时要考虑分隔符的字符列表. (default: './')
  • 修饰符
? 零或一个|可选的
* 零或更多
+ 一个或多个
(.*) 通配符