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

@citolab/pci-authoring

v3.1.0

Published

write QTI 3 items and packages with a PCI of the PCI Authoring Profile, in a browser or in Node

Readme

@citolab/pci-authoring

Write QTI 3 items and packages with a PCI of the PCI Authoring Profile, as an authoring system does: the properties as data- attributes, the author's files in the markup slots (data-pci-slot), the PCI's fixed media (data-pci-media) and further modules, and the scoring. No dependencies; it runs in a browser and in Node. The tspci dev page and pci-showcase use it for their "QTI 3 package" download.

import { pciFiles, qtiPackage, zip } from "@citolab/pci-authoring";

const descriptor = await (await fetch(`${pciFolder}authoring.json`)).json();
const files = {};
for (const file of pciFiles(descriptor)) files[file] = new Uint8Array(await (await fetch(pciFolder + file)).arrayBuffer());

const bytes = zip(
  qtiPackage(descriptor, {
    files, // the PCI's files, relative to its module
    properties: { task: "moment" }, // one data- attribute each; missing ones get their default
    slots: { video: { name: "bunny.mp4", data: videoBytes } }, // the author's files per markup slot
    correct: "4.5", // the correct response: correctFromResponse(pci.getResponse()) when the author answered
    margin: 0.5, // optional, for a response with tolerance: 4.0 to 5.0 counts as correct
    language: "en",
  })
);

| Export | | | --- | --- | | pciFiles(descriptor) | The files an item needs next to the PCI's module: the module, authoring.json, fixed media, further modules | | itemXml(descriptor, options) | The item alone, with resolve(file) for where the PCI's files are (a preview passes absolute URLs) | | qtiPackage(descriptor, options) | The files of a package with the item, a test and the manifest: resources/pci/, items/, items/media/ | | itemProblems(descriptor, { properties, slots, language }) | What keeps the item from being written as set up: a required slot without a file ("Video: choose a file first"), a required property without a value, an enum value not in its options, a number outside min/max. Check it before qtiPackage | | zip(files) | A zip of path → bytes or text (stored, the same bytes for the same files) | | itemScoring(descriptor, asked) | The scoring an item gets: asked when offered, else the first of scoring | | correctFromResponse(response) | What getResponse() reports as correct-response values: { base: { integer: 30 } } → "30", a record → { time: "4.1", point: "455 250" } | | appliedFields(descriptor, properties) | The record fields whose when holds for these properties |

Correct responses and margins. With match_correct, itemXml/qtiPackage write the correct response and the response processing: exact (QTI's match_correct), or, for a response or record field with tolerance, within a margin: margin: 0.5 (± 0.5) or { min, max } for a range, a radius for an area (qti-inside a circle). A record is compared field by field (margins: { time: 0.5, point: 20 }), only the fields whose when holds.