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

mizzoureview-reading

v2.1.2

Published

This module defines TypeScript classes for modeling professor data, including identity, metrics, and AI-generated summaries.

Downloads

6

Readme

Professor Models

This module defines TypeScript classes for modeling professor data, including identity, metrics, and AI-generated summaries.


📦 Classes Overview

BasicInfo

Represents a professor’s personal and departmental details.

Fields:

  • name: Name – A Name object (imported from ./name)
  • department: string – Department name, like "School of Natural Resources"
  • title?: string(Optional) Title like "Part-Time Adjunct Faculty", or "Emeritus"
  • education?: string(Optional) Educational background, like "Doctor of Philosophy"
  • tenure?: number(Optional) Years of tenure.

Method:

  • toString() – Returns a string combining name and department, with slashes removed.

ObjectiveMetrics

Represents quantifiable metrics such as GPA and confidence level.

Fields:

  • gpa: number – Must be between 0 and 4.0.
  • confidence: number – Must be between 0 and 100.

Constructor Validation: Throws an error if values are out of range.


SubjectiveMetrics

Represents student-supplied qualitative metrics, rated from 0–10.

Optional Fields:

  • quality
  • difficulty
  • gradingIntensity
  • attendance
  • textbook
  • polarizing

Constructor Validation: Each metric must be between 0 and 10 if provided.


AIPromptAnswers

Stores AI-generated content related to the professor.

Optional Fields:

  • letterToProfessor?: string – A letter directed to the professor.
  • letterToStudent?: string – A letter directed to the student.
  • funFacts?: string[] – Facts derived from wikipedia articles, must be an array of length 5 for each fact.

Professor

The main class encapsulating all other class data.

Fields:

  • professorId: string
  • basicInfo?: BasicInfo
  • objectiveMetrics?: ObjectiveMetrics
  • subjectiveMetrics?: SubjectiveMetrics
  • aIPromptAnswers?: AIPromptAnswers

Methods:

  • static initFromObject(jsonObject: any): Professor
    Creates a Professor instance from a raw JSON object.
  • toString(): string
    Returns a full, stringified version of the object and all nested data.

✅ Example Usage

import { Professor } from "./professor";
import { Name } from "./name";

const name = new Name("Ada", "Lovelace");
const basicInfo = new BasicInfo(name, "Computer Science", {
    title: "Professor",
    education: "PhD in Mathematics",
    tenure: 10,
});

const objectiveMetrics = new ObjectiveMetrics(3.9, 95);
const subjectiveMetrics = new SubjectiveMetrics({
    quality: 9,
    difficulty: 6,
});
const aiAnswers = new AIPromptAnswers({
    letterToStudent: "Keep pushing forward!"
});

const prof = new Professor("ada123", {
    basicInfo,
    objectiveMetrics,
    subjectiveMetrics,
    aIPromptAnswers: aiAnswers,
});

console.log(prof.toString());

Functions

database client

getProfessorsFromName(db: Firestore, fname: string, lname: string): Promise<Professor[]>

Fetches all professors from Firestore whose first and last names match the provided values.

📥 Parameters

  • db (Firestore) – A Firestore instance from the Firebase Web Client SDK.
  • fname (string) – The first name of the professor to search for.
  • lname (string) – The last name of the professor to search for.

📤 Returns

  • A Promise that resolves to an array of Professor objects that match the given first and last name.

🧠 Notes

  • Ignores middle name, so returns multiple values upon there being multiple "James Williams", for example.

🧪 Example

import { getProfessorsFromName } from "mizzoureview-reading/database-client";
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
    /* your config */
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

const profs = await getProfessorsFromName(db, "John", "Doe");
console.log(profs);

getProfessorsFromDepartment(db: Firestore, department: string): Promise<Professor[]>

Fetches all professors from Firestore who belong to a specific department.

📥 Parameters

  • db (Firestore) – A Firestore instance from the Firebase Web Client SDK.
  • department (string) – The name of the department to filter professors by.

📤 Returns

  • A Promise that resolves to an array of Professor objects that match the department.

🧠 Notes

  • See this page to see some examples of what "department" means

🧪 Example

import { getProfessorsFromDepartment } from "mizzoureview-reading/database-client";
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
    /* your config */
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

const profs = await getProfessorsFromDepartment(db, "Computer Science");
console.log(profs);

getProfessorFromID(db: Firestore, professorId: string): Promise<Professor | null>

Fetches a single professor from Firestore by their unique professorId.

📥 Parameters

  • db (Firestore) – A Firestore instance from the Firebase Web Client SDK.
  • professorId (string) – The document ID of the professor to retrieve.

📤 Returns

  • A Promise that resolves to a Professor object if found and valid, or null otherwise.

🧠 Notes

  • Returns null if the document is missing, malformed, or incomplete.

🧪 Example

import { getProfessorFromID } from "mizzoureview-reading/database-client";
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
    /* your config */
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

const prof = await getProfessorFromID(db, "abc123");
console.log(prof);

getSomeProfessors(db: Firestore, count: number): Promise<Professor[]>

Retrieves a limited number of professors from the professors collection in Firestore using the Firebase Web Client SDK.

📥 Parameters

  • db (Firestore) – A Firestore instance imported from firebase/firestore.
  • count (number) – The maximum number of professor documents to retrieve.

📤 Returns

  • A Promise that resolves to an array of Professor objects, up to the specified count.

🧠 Notes

  • Best for use in testing database connection or getting a small amount of data to practice rendering stuff or something

🧪 Example

import { getSomeProfessors } from "mizzoureview-reading/database-client";
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
    /* your config */
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

const profs = await getSomeProfessors(db, 5);
console.log(profs);

getAllProfessors(db: Firestore): Promise<Professor[]>

Retrieves all professors from the professors collection in your Firestore database using the Firebase Web Client SDK.

📥 Parameters

  • db (Firestore) – A Firestore instance imported from firebase/firestore.

📤 Returns

  • A Promise that resolves to an array of Professor objects. Only professors with valid basicInfo and a defined professorId are returned.

🧠 Notes

  • Internally calls Professor.initFromObject(doc.data()) to construct each Professor.
  • Skips documents that are missing required fields (professorId or basicInfo).

🧪 Example

import { getAllProfessors } from "mizzoureview-reading/database-client";
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
    /* your config */
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);

const profs = await getAllProfessors(db);
console.log(profs);