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

taleem-test

v1.0.0

Published

A deterministic, extensible test evaluation engine for structured assessments.

Readme

taleem-test

A deterministic, extensible test evaluation engine for structured assessments.

taleem-test is a pure evaluation kernel.
It does not handle UI, storage, timing, or networking.

It only:

  • checks a single question
  • checks a full test
  • aggregates results
  • supports pluggable question types

Philosophy

  • Pure evaluation logic
  • Stateless engine
  • UI-agnostic
  • Runtime-agnostic (browser or backend)
  • Extensible question types
  • Deterministic output

Security depends on where you run the engine, not the engine itself.


Supported Question Types (Core)

  • mcq (single choice)
  • multi (multi-select)
  • numeric
  • short (short text)
  • match
  • order

Installation

npm install taleem-test

(or local usage in monorepo)


Basic Usage

import { createTestEngine } from "taleem-test";

const engine = createTestEngine();

const question = {
  id: "q1",
  type: "mcq",
  marks: 2,
  data: {
    correct: "b"
  }
};

const answer = {
  questionId: "q1",
  value: "b"
};

const result = engine.checkAnswer(question, answer);

console.log(result);
/*
{
  questionId: "q1",
  correct: true,
  score: 2,
  maxScore: 2
}
*/

Evaluating a Full Test

const test = {
  id: "t1",
  questions: [question]
};

const answers = [
  { questionId: "q1", value: "b" }
];

const result = engine.checkTest(test, answers);

console.log(result);
/*
{
  testId: "t1",
  totalQuestions: 1,
  attempted: 1,
  correctCount: 1,
  totalScore: 2,
  maxScore: 2,
  percentage: 100,
  results: [...]
}
*/

Question Structure

All questions share a base structure:

{
  id: "q1",
  type: "mcq",
  marks: 2,
  data: { ... }
}

Each type defines its own data shape.


Extending with Custom Question Types

engine.registerType("custom", (question, answer) => {
  const isCorrect = someCheckLogic(question, answer);

  return {
    questionId: question.id,
    correct: isCorrect,
    score: isCorrect ? question.marks : 0,
    maxScore: question.marks
  };
});

Security Model

taleem-test does not enforce security.

  • In practice mode → run in browser.
  • In exam mode → run on backend.
  • Backend should strip correct before sending to client.

Same engine. Different runtime.


What This Library Does NOT Do

  • No UI rendering
  • No timing enforcement
  • No answer storage
  • No authentication
  • No network calls
  • No persistence
  • No session management

It is a pure evaluation kernel.


Testing

npm test

Fully unit-tested using Vitest.


License

MIT