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

abc-core

v0.0.9

Published

Core package for the repo

Downloads

249

Readme

@abc/core

Core package containing essential functions and data processing logic for the ABC system.

📦 Installation

pnpm add @abc/core

🚀 Key Features

Â

1. Test Data Processing

  • Create and manage different types of tests (practice, final, diagnostic)
  • Process test data with different game modes
  • Automatically generate diagnostic tests based on topics and questions

2. Topics Management

  • Process and map topics with test data
  • Generate slugs for topics
  • Calculate average level of topics

3. Branch Test

  • Handle branch tests for special applications (like ASVAB)
  • Create branched test structures

4. Utilities

  • Generate random IDs
  • Fetch questions from API
  • Create group exam data
  • Process questions by topics

📚 API Reference

Test Processing

processTestData(options)

Process test data and create different types of tests.

import { processTestData } from "@abc/core";

const result = await processTestData({
  topics: ITopic[],
  tests: ITestData,
  questions: IQuestion[],
  appShortName: string,
  state?: string
});

handleGetBranchTest(options)

Handle branch tests for special applications.

import { handleGetBranchTest } from "@abc/core";

const { data, slugsBranch } = await handleGetBranchTest({
  topics: ITopic[],
  questions: IQuestion[],
  appShortName: string
});

getDiagnosticTest(topics, questions)

Automatically generate diagnostic tests.

import { getDiagnosticTest } from "@abc/core";

const diagnosticTest = getDiagnosticTest(topics, questions);

Topics Processing

processTopics(options)

Process topics and generate slugs.

import { processTopics } from "@abc/core";

const { slugsTopic, questions, listTopics } = await processTopics({
  topics: ITopic[],
  app: string,
  state?: string,
  isParent?: boolean
});

mapTopicsAndTest(options)

Map topics with test data.

import { mapTopicsAndTest } from "@abc/core";

const { questions, topics } = mapTopicsAndTest({
  data: IData[],
  topic: ITopic,
  slug: string
});

calculateAverageLevelTopic(topics)

Calculate average level of topics.

import { calculateAverageLevelTopic } from "@abc/core";

const averageLevel = calculateAverageLevelTopic(topics);

Utilities

generateRandomId()

Generate random ID.

import { generateRandomId } from "@abc/core";

const id = generateRandomId(); // "abc123def456"

generateRandomNegativeId(exclude?)

Generate random negative ID.

import { generateRandomNegativeId } from "@abc/core";

const negativeId = generateRandomNegativeId(-1); // -123456

getQuestionByTopics(id, app, state?)

Fetch questions from API by topic ID.

import { getQuestionByTopics } from "@abc/core";

const questions = await getQuestionByTopics(123, "asvab", "california");

getRandomQuestion(questions)

Get random question from list.

import { getRandomQuestion } from "@abc/core";

const randomQuestion = getRandomQuestion(questions);

generateGroupExamData(options)

Generate group exam data from topics and questions.

import { generateGroupExamData } from "@abc/core";

const groupData = generateGroupExamData({
  topics: ITopic[],
  questions: IQuestion[],
  currentIndex?: number
});

fetchQuestionsForTopics(options)

Fetch questions for multiple topics.

import { fetchQuestionsForTopics } from "@abc/core";

const questions = await fetchQuestionsForTopics({
  selectListTopic: ITopic[],
  target: number,
  excludeListID?: number[],
  isHard?: boolean,
  questions: IQuestion[]
});

🧪 Testing

# Run tests
pnpm test

# Run tests with coverage
pnpm test:coverage

# Run tests once
pnpm test:run

🔧 Development

# Build package
pnpm build

# Development mode
pnpm dev

# Clean dist
pnpm clean

📦 Dependencies

Production Dependencies

  • axios - HTTP client
  • commander - CLI framework
  • node-fetch - Fetch API
  • p-limit - Concurrency control
  • uuid - UUID generation
  • abc-model - Data models
  • abc-constants - Constants
  • abc-router - Routing utilities

Development Dependencies

  • @repo/eslint-config - ESLint configuration
  • @types/node - Node.js types
  • vitest - Testing framework
  • @repo/mock - Mocking utilities
  • @vitest/coverage-v8 - Coverage reporting
  • jsdom - DOM environment for tests

📄 License

MIT