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

@brighterly/lib-assessment

v1.1.0

Published

Brighterly assessment player: engine, player state machine and renderers, host-agnostic

Readme

@brighterly/lib-assessment

The Brighterly assessment player: the engine (schema, graders, [[token]] templates), the player state machine and the question renderers, as one Vue 3 package.

It knows nothing about the app that mounts it: no auth, no kid, no routing, no analytics SDK. Everything it waits on comes from a host object; everything it reports goes out as events. Used by app-student (the standalone player) and cs-app (the classroom), and, in readonly mode, by the tutor's live view and the screen recorder.

Install

pnpm add @brighterly/[email protected]   # pin exactly — no ^

Peer dependencies: vue ^3.5, @vueuse/core ^14, katex ^0.17, @brighterly/lib-core-types >=0.57.1.

The host loads three stylesheets once, globally:

import '@brighterly/lib-lumee-ui/dist/client.css' // the --btly-* tokens the player uses
import 'katex/dist/katex.min.css'
import '@brighterly/lib-assessment/style.css'

Live mode

<script setup lang="ts">
import { AssessmentPlayer, createStudentApi, type AssessmentHost } from '@brighterly/lib-assessment'

const host: AssessmentHost = {
  api: createStudentApi({
    request: (path, init) => myStudentApiFetch(path, init), // your base URL + bearer
    kidId: () => activeKidId(),
  }),
  uploads: {
    audio: (scope, blob, mimeType) => uploadAudio(scope, blob, mimeType), // → stored object path
    photo: (scope, photo) => uploadPhoto(scope, photo),                   // → stored object path
    remove: (scope, kind) => removeUpload(scope, kind),
  },
  // The package stops this track when a take ends. In a call, hand it a clone of the
  // call's mic track, so stopping it keeps the call's mic.
  audioSource: async () => (await navigator.mediaDevices.getUserMedia({ audio: true })).getAudioTracks()[0]!,
  mediaUrl: path => `${MEDIA_BASE}/${path}`,
  track: ({ name, props }) => amplitude.track(WIRE_NAMES[name], { ...props, kid_id, booking_id }),
}
</script>

<template>
  <AssessmentPlayer
    :assessment-id="id"
    :kid-name="kidName"
    :host="host"
    @change="state => broadcast(state)"
    @status="status => …"
    @finish="goHome"
    @error="message => …"
  />
</template>

| Prop | Type | | |---|---|---| | assessmentId | string | the assessment instance id | | kidName | string | fills [[kid_name]] | | mode | 'live' \| 'readonly' | default live | | host | AssessmentHost | required in live mode | | state | AssessmentState | readonly only: the state to draw |

| Event | Payload | When | |---|---|---| | change | AssessmentState | every answer, navigation, load and submit | | status | PlayerStatus | every status change | | finish | — | the kid pressed "Continue learning" on the last screen | | error | string | the status became error; the message is kid-safe |

Readonly mode

<AssessmentPlayer assessment-id="3" kid-name="Mia" mode="readonly" :state="stateFromTheKid" />

It makes no requests (other than the media files it shows), plays no sound and takes no input: the screen is inert. AssessmentState is plain JSON — a format version, the assignment, the stored definition, the answers (audio answers without their in-memory blob), the screen index, the signed media map and the player's size.

Layout

The player sizes itself by its container, not the window (container-name: assessment): give it a box with a width and a height, a page or a classroom stage.

Analytics

The package calls host.track({ name, props }) with domain names and assessment facts only. The host maps the names to its own wire names and adds the kid, discipline and booking. The names are provisional until analytics signs them off.

| Name | When | Extra props | |---|---|---| | assessment_opened | the load resolved | | | assessment_started | the start resolved | | | assessment_answered | 600 ms after the last edit of an answer | question_number, interaction, response_kind | | assessment_submitted | the submit resolved | answered_count | | assessment_failed | the status became error | error |

Every event carries assessment_id, status, discipline, grade_label, screen_idx, total_screens. Readonly mode tracks nothing.

Development

pnpm install      # also points git at _tools/git: the pre-commit hook runs codestyle precommit
pnpm invariants   # codestyle check (@brighterly/lib-fe-codestyle rules)
pnpm validate     # codestyle validate: invariants, lint, typecheck, test, build
pnpm playground   # http://localhost:5199 — a live player beside a readonly copy, fake host

CI is .github/workflows/publish.yml, the @brighterly/lib-fe-codestyle pattern: pnpm validate on every PR and push to main; on main, when npm does not have the package.json version yet, the validated dist/ is published (needs the NPM_TOKEN secret). Release = a version bump merged to main.