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

@mmogib/kfupm-courses

v1.0.0

Published

CLI tool to scrape KFUPM course offerings

Readme

KFUPM Course Scraper

A TypeScript CLI tool to scrape course offerings from KFUPM's registrar website.

Installation

Local Development

  1. Clone or download the repository
  2. Install dependencies:
npm install
  1. Install Playwright browsers:
npx playwright install chromium

Global Installation

Once published to npm:

npm i -g @mmogib/kfupm-courses

This will also install the Chromium browser used by Playwright.

For local linking during development (no npm publish needed):

npm run setup

This installs dependencies, installs Playwright Chromium, builds, and links the CLI globally.

Usage

List Available Departments

kfupm-courses list-departments
# or
kfupm-courses list
# or
kfupm-courses depts

Scrape Courses

There are multiple ways to scrape courses:

Option 1: Using explicit flags

kfupm-courses scrape --term 251 --dept "Mathematics"
kfupm-courses scrape -t 252 -d "Math"

Option 2: Using positional arguments

kfupm-courses 251 "Math"
kfupm-courses 252 "Computer Science"

Option 3: Specify custom output directory

kfupm-courses scrape -t 251 -d "Math" -o "/path/to/output"
kfupm-courses 252 "ICS" --output "C:\MyFolder"

Department Shortcuts

You can use department shortcuts instead of full names:

  • Math or Mathematics → Mathematics
  • CS or ICS → Information & Computer Science
  • ME or Mechanical → Mechanical Engineering
  • EE or Electrical → Electrical Engineering
  • PE or Petroleum → Petroleum Engineering
  • And many more...

Use kfupm-courses list to see all available departments and their shortcuts.

Examples

# Scrape Math courses for term 251
kfupm-courses 251 "Math"

# Scrape Computer Science courses for term 252
kfupm-courses scrape -t 252 -d "CS"

# Scrape Electrical Engineering with custom output
kfupm-courses 253 "EE" -o "D:\Courses"

# List all departments
kfupm-courses list-departments

Output

CSV files are saved with the following format:

term{TERM}_{DEPT}_{TIMESTAMP}.csv

Example: term251_mathematics_2024-12-07T15-30-45.csv

Default output directory: the current working directory

Development

Available Scripts

# One-command setup (install, build, link)
npm run setup

# Build and link globally
npm run build-link

# Build only
npm run build

# Development mode (no build required)
npm run dev -- scrape -t 251 -d "Math"

# Test run (builds first)
npm start -- 251 "Math"

CSV Format

The output CSV includes the following columns:

  • Course-Sec
  • Activity
  • CRN
  • Course Name
  • Instructor
  • Day
  • Time
  • Location
  • Instructional Method

Error Handling

The tool provides clear error messages for:

  • Invalid term numbers
  • Invalid department names
  • Network errors
  • Missing data

Requirements

  • Node.js >= 16
  • npm >= 7
  • Internet connection

License

MIT