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 🙏

© 2025 – Pkg Stats / Ryan Hefner

urx

v0.3.0

Published

URl eXaminer

Readme

urx

URl eXaminer

Description

Verify the availability of URLs in supplied document. urx will try to request the URLs one by one. By default, those responsed successfully with statusCode >= 200 and < 400 will be marked with check sign √ (U+221A) and followed with the statusCode, the others will be marked cross sign × (U+00D7) and followed with statusCode or error message if no response available. You may also customise requesting gestures and define expected responses, see API or Supported Text Formatting.

ToC

Get Started

# Install globally.
npm install -g urx

# Examine URLs in foobar.md.
urx foobar.md

API

urx also offers API to verify URL in code:

const urx = require('urx');

urx(options, (err, ret) => {
    if (err) {
        // ...
    }
    else {
        // ...
    }
});

urx(options)
    .then(function(response) {
        // ...
    })
    .catch(function(ex) {
        // ..
    })
    ;
  • Promise urx(string urlname)
  • Promise urx(object options)
  • void urx(string urlname, Function callback)
  • void urx(object options, Function callback)

In argument options:

  • options.url string
  • options.request object OPTIONAL
  • options.request.headers object OPTIONAL//
  • options.response object OPTIONAL
  • options.response.statusCode number OPTIONAL
  • options.response.headers object OPTIONAL

options.request is used to customise the request. And options.response descibes the expected response.

In promise mode:

  • On-resolved argument will be an object containing only one property response.
  • On-rejected argument will be an error.

In callback mode:

  • Function callback will receive one or two arguments.
  • The first represents an error and will be equal to null if the URL is available.
  • The second will be absent or be an object containing only one property response.
  • Here is something unusual that the second argument MAY be present even when the first one is not null that means the URL is not available.

Refer to htp to find what response is.

Supported Text Formatting

So far, Markdown is the only text format accepted by urx:

  • The URLs expected to be examined should occupy an entire line.
  • Lines start with ^. are indicators for urx.
<!-- The following URL will be examined. -->
http://www.example.com/

<!-- Use simple JavaScript code in URL. -->
http://www.example.com/?time=${Date.now()}

<!-- The next command line tells urx to skip following URLs. -->
^.IGNORE.START
http://1.example.com/
http://2.example.com/
^.IGNORE.END
<!-- Stop skipping. -->

^.RESPONSE.statusCode 302
<!-- The next URL is expected to be responsed with statusCode 302. -->
<!-- This command will be applied on ONLY the first following URL. -->
http://302.example.com/

^.REQUEST.headers { "Host": "www.example.com" }
<!-- The next URL will be sent together with special headers. -->
<!-- This command will be applied on ONLY the first following URL. -->
http://10.0.0.1/

Here is an example of test case written in MarkDown (please read in Raw mode).