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

ots-xt-q

v0.1.3

Published

Looks at XML Team files and determines the fixture type. This pushes the file onto a Thoonk Job Queue to be consumed downstream.

Downloads

1

Readme

Reads files from XML Team and puts them onto Thoonk job queues

Reads the file and uses xml-stream to isolate the <sports-metadata/> node. This tells us on which type of queue the file should be placed for downstream processing.

Requirements

Assumes REDIS is already running.

How to Use It

Install globally with npm install -g ots-xt-q. There are two ways to use this script.

  1. Invoked with command line arguments:

ots-xt-q --file path/to/file.xml

  1. Pipe in a list of files:

find path/to/files/ -type f | ots-xt-q

The inotify configuration with incrontab will invoke the script via option 1. The only time you might be piping in a list of files is if you are batch processing a bunch of files. In this case, you're likely reprocessing them.

Job Queue Types

Since we're interested in parallelizing the processing of jobs, there are two main queue types.

  1. general: files that come in less frequently.
  2. progressive: real-time data files received during games.

Queues are separated by sport. XML Team uses the concept of leagues to identify a sport at the most granular level. For example, MLB Baseball has a league code of l.mlb.com while NFL football has a league code of l.nfl.com. The job queuer will therefore place files onto the following types of queues:

  • l.mlb.com:general
  • l.mlb.com:progressive
  • l.nfl.com:general
  • l.nfl.com:progressive

This will allow us to prioritize and process each queue as we see fit downstream.

Assumptions

  1. You are reading XML Team files that may or may not contain a <sports-metadata> node
  2. REDIS is running and you can connect to it.

CLI Options

  • --file: the relative or absolute path to the file of interest
  • --logs: relative or absolute path to logs. Assumes ./logs if none specified.
  • --host: REDIS host. Default localhost
  • --port: REDIS port. Default 6379
  • --db: REDIS db index. Default 0