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

@sobtid/fastify-exambank

v0.3.23

Published

> Exam bank service

Downloads

117

Readme

fastify-exambank

Exam bank service

Usage

const fastify = require('fastify')()

fastify.register(require('@sobtid/fastify-exambank'), {
  hostUrl:  // exanbank.hosturl,
  appId:    // exanbank.appid
})

fastify.post('/grades', (req, reply) => {
  // some code api
  const grades = fastify.exambank.getGrades()
  reply.send(grades)
})

fastify.listen(3000, err => {
  if (err) throw err
})

Data Source

Exam

{
  "id": String,
  "applicationId": String,
  "gradeId": String,
  "subjectId": String,
  "classId": String,
  "subClassId": Array<String>,
  "questions": Array<Question>,
  "categories": Array<{
    "id": String,
    "name": String,
    "amount": Number,
    "gradeId": String,
    "classId": String,
    "subjectId": String,
    "isActive": Boolean,
    "createdAt": Timestamp
  }>,
  "publisher": Object<{
    "id": String,
    "name": String,
    "logo": String<URL>
    "createdAt": Timestamp
  }>
  "name": String,
  "createdBy": Object<{
    "id": String,
    "displayName": String
  }>,
  "totalScore": Number,
  "isActive": Boolean,
  "tesingTime": Number, 
  "testingLimit": Number,
  "testingDurationEnable": Boolean,
  "testingDuration": Object<{
    "start": Timestamp,
    "end": Timestamp
  }>,
  "displaySolution": Object<{
    "score": Boolean,
    "answer": Boolean
  }>,
  "shuffling": Object<{
    "question": Boolean,
    "answer": Boolean
  }>,
  "createdAt": Timestamp,
  "updatedAt": Timestamp
}

Video

{
  "id": String,
  "name": String,
  "publisherId": Object<{
    "id": String,
    "name": String,
    "logo": String<URL>
  }>,
  "gradeId": Object<{
    "id": String,
    "name": String
  }>,
  "subjectId": Object<{
    "id": String,
    "name": String
  }>,
  "classId": Object<{
    "id": String,
    "name": String
  }>,
  "subClassId": Object<{
    "id": String,
    "name": String
  }>,
  "previewImage": Object<{
    "smallSize": String,
    "largeSize": String
  }>,
  "file": Object<{
      "md": String,
      "hls": String,
      "hd": String
  }>,
  "createdBy": String
}

API List

List grade

fastify.exambank.getGrades()

List subject

fastify.exambank.getSubjects(params)
params = {
  gradeId: String
}

List class

fastify.exambank.getClass(params) 
params = {
  subjectId: String
}

List subclass

fastify.exambank.getSubClass(params)
params = {
  "gradeId": String,
  "subjectId": String,
  "classId": String
}

Update subclass

fastify.exambank.updateSubClass(subclassId, data)
subclassId: String

data = {
  "name": String,
  "isActive": Boolean
}

List Publisher

fastify.exambank.getPublishers()

Create Publisher

fastify.exambank.createPublisher(params)
params = {
  "name": String,
  "logo": String // Base64 encode
}

Update Publisher

fastify.exambank.updatePublisher(publisherId, params)
publisherId: String

params = {
  "name": String,
  "logo": String // Base64 encode
}

Delate Publisher

fastify.exambank.removePublisher(publisherId)
publisherId: String

List Exam

fastify.exambank.getExams(params)
// Optional

params = {
  "gradeId": String,
  "subjectId": String,
  "classId": String,
  "publisherId": String,
  "createdBy": String,
  "id": [String] // List examId
}

Exam detail

fastify.exambank.getExamDetail(examId)
examId: String

Update Exam Stat

fastify.exambank.sendExamTestingStats(examId, totalScore, testingStatsData)
examId: String
totalScore: Number // total score of user got from testing
testingStatsData: [
  {
    "type": 'MC',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [String] // Array of choice id
  },
  {
    "type": 'ST',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": String
  },
  {
    "type": 'MA',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [
      {
        "id": String, // Left choice id
        "match": String // Right choice id
      }
    ]
  },
  {
    "type": 'SQMC',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [
      {
        "id": String,
        "answer": [String] // Array of choice id
      }
    ]
  },
  {
    "type": 'SQST',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [
      {
        "id": String,
        "answer": String
      }
    ]
  }
]

Update Questions Stat

fastify.exambank.sendQuestionTestingStats(params)
params: [
  {
    "type": 'MC',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [String] // Array of choice id
  },
  {
    "type": 'ST',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": String
  },
  {
    "type": 'MA',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [
      {
        "id": String, // Left choice id
        "match": String // Right choice id
      }
    ]
  },
  {
    "type": 'SQMC',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [
      {
        "id": String,
        "answer": [String] // Array of choice id
      }
    ]
  },
  {
    "type": 'SQST',
    "questionId": String,
    "isCorrect": Boolean,
    "timeUsed": Number,
    "answer": [
      {
        "id": String,
        "answer": String
      }
    ]
  }
]

Create user

fastify.exambank.createUser(params)
// Optiona

params = {
  "displayName": String,
  "email": String,
  "password": String,
  "role": String,
  "avatar": String, // Base64 encode
  "publisherId": String
}

Update user

fastify.exambank.editUser(userId, params)
// Optional

userId: String

params = {
  "displayName": String,
  "email": String,
  "password": {
    "old": String,
    "new": String
  },
  "avatar": String, // Base64 encode
  "publisherId": String
}

Question detail

fastify.exambank.getQuestionDetail(questionId)
questionId: String

Total question by type

fastify.exambank.getQuestionStats(type)
type: Enum { grade, type, status }

List random question

fastify.exambank.randomQuestions(params)
// Optional

params = {
  "gradeId": String,
  "subjectId": String,
  "classId": String,
  "subClassIds": String,
  "limit": Number
}

List Bundle

fastify.exambank.getBundles(params)
// Optional

params = {
  "level": String,
  "gradeId": String,
  "subjectId": String,
  "id": [String] // List bundleId
}

Bundle detail

fastify.exambank.getBundleDetail(bundleId)
bundleId: String

Bundle relate

fastify.exambank.getBundleRelate(bundleId)
bundleId: String

List of video

fastify.exambank.getVideos(params)
// Optional

params = {
  "gradeId": String,
  "subjectId": String,
  "classId": String,
  "publisherId: String",
  "createdBy": String
}