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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dgtools/udisc-events

v0.2.3

Published

An interface for querying udisc event data

Readme

@imccausl/udisc-events

Server-side helper for scraping public UDisc event listings and leaderboards. It wraps the event search page and leaderboard export into a small API.

Requirements

  • Run in a Node.js server/runtime (fetching UDisc from the browser will fail due to CORS). Node 18+ is recommended for the built-in fetch.

Installation

npm i @imccausl/udisc-events
# or
yarn add @imccausl/udisc-events
# or
pnpm add @imccausl/udisc-events

Quick start

import { EventsQuery } from '@imccausl/udisc-events'

const query = new EventsQuery({
  query: 'Maple Hill',
  latitude: 42.3,
  longitude: -71.8,
  searchRadius: 80,
  quickFilter: 'tournament',
})

const events = await query.events() // array of events or an error shape
const latest = await query.latestEvent()

if (latest?.exportUrl) {
  const leaderboard = await query.leaderboard(latest.exportUrl)
  console.log(latest.name, leaderboard.length)
}

API

new EventsQuery(query)

Creates a query against https://udisc.com/events.

Query options:

  • query: free-text search term.
  • latitude, longitude, searchRadius: narrow results around a location (kilometer radius).
  • quickFilter: one of all, my-events, trending, tournament, league, pdga, course-cleanup, glow, clinics, women, charity.
  • type: array of event types (league, clinic, clean-up, non-dg).
  • tag: array of tags (glow-round, ace-pool, charity, female-friendly, beginner-friendly, junior-friendly, bag-tags).
  • handicapScoring: true to include handicap events.
  • dates: past or custom (absence means upcoming).
  • dateDuration: day | week | month (omit when using custom).
  • startsOnOrBefore / endsOnOrAfter: ISO date strings, required when dates: 'custom'.

Methods

  • events(): Promise<Event[] | ErrorResponse>: Parsed events or { error: true, status, message } when the request fails.
  • latestEvent(): Promise<Event | null>: Most recent event from the current result set (null on error or no events).
  • leaderboard(exportUrl): Promise<Record<string, any>[] | ErrorResponse>: Downloads the Excel export for the given event and returns rows as JSON.
  • latestLeaderboard(): Promise<{ event: Event; leaderboard: any[] } | ErrorResponse>: Fetches the newest event and its leaderboard in one call; returns an error object if nothing is available.

Event shape

{
  name: string
  date: string | null // ISO date
  day: 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun' | null
  exportUrl: string | null
  pageUrl: string | null
  courseName: string | null
  location: string | null
}

Example server route

Use the library from a server to avoid CORS:

import express from 'express'
import { EventsQuery } from '@imccausl/udisc-events'

const app = express()

app.get('/api/udisc/latest', async (_req, res) => {
  const query = new EventsQuery({ query: 'league', quickFilter: 'league' })
  const latest = await query.latestLeaderboard()
  res.json(latest)
})

app.listen(3000)

Notes

  • The library scrapes public pages; be respectful of UDisc and avoid unnecessary traffic.
  • Responses that fail network or CORS checks return an error object instead of throwing; check for error before using the data.