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

@lxpack/scorm

v0.7.0

Published

SCORM and standalone HTML export for LXPack

Readme

@lxpack/scorm

Documentation npm version CI License Node.js

SCORM 1.2, SCORM 2004 (multi-SCO), and standalone HTML export for LXPack courses.

Part of LXPack. Docs: Export to LMS · Tracking and completion.

| Related | Package | |---------|---------| | CLI | @lxpack/cli | | Manifest validation | @lxpack/validators | | Embedded client | @lxpack/runtime | | Components bundle | @lxpack/components |

Install

npm install @lxpack/scorm

Requires Node.js 18 or 20 (18+).

Usage

SCORM 1.2 or standalone ZIP

import { readFile } from "node:fs/promises";
import type { CourseManifest } from "@lxpack/validators";
import { buildRuntimeAssessmentBundle } from "@lxpack/validators";
import {
  packageCourse,
  packageStandaloneDir,
  buildIndexHtml,
  collectFiles,
  safeJsonForHtml,
  courseSlug,
} from "@lxpack/scorm";

const courseDir = "/path/to/my-course";
const manifest: CourseManifest = /* from validateCourse */;
const assessmentBundle = await buildRuntimeAssessmentBundle(courseDir, manifest);

const runtimeClientJs = await readFile("path/to/client.js", "utf8");
const runtimeCss = await readFile("path/to/styles.css", "utf8");
const componentsJs = await readFile("path/to/bundle.js", "utf8"); // optional

await packageCourse({
  courseDir,
  manifest,
  target: "scorm12",
  outputPath: "/path/to/output/course-scorm12.zip",
  runtimeClientJs,
  runtimeCss,
  componentsJs,
  assessmentBundle,
});

SCORM 2004 multi-SCO

import { packageScorm2004, buildScoIndexHtml, listCourseActivities } from "@lxpack/scorm";

const activities = listCourseActivities(manifest);

await packageScorm2004({
  courseDir,
  manifest,
  outputPath: "/path/to/output/course-scorm2004.zip",
  runtimeClientJs,
  runtimeCss,
  componentsJs,
  assessmentBundle,
});

Each activity gets sco/<activityId>/index.html (via buildScoIndexHtml). Shared assets include lxpack-runtime.js and lxpack-components.js. generateScorm2004Manifest emits imsmanifest.xml with IMS Simple Sequencing metadata.

Standalone directory

await packageStandaloneDir({
  courseDir,
  manifest,
  target: "standalone",
  outputDir: "/path/to/output/standalone",
  runtimeClientJs,
  runtimeCss,
  componentsJs,
  assessmentBundle,
});

Most users should use lxpack build from @lxpack/cli instead of calling these APIs directly. See CLI reference for --target options.

Exports

| Export | Description | |--------|-------------| | packageCourse(options) | Build a SCORM 1.2 or standalone ZIP | | packageScorm2004(options) | Build a SCORM 2004 multi-SCO ZIP | | packageStandaloneDir(options) | Write an unpacked directory | | listCourseActivities(manifest) | Ordered activities for multi-SCO layout | | generateImsManifest(manifest, files) | SCORM 1.2 imsmanifest.xml | | generateScorm2004Manifest(...) | SCORM 2004 manifest with sequencing | | buildIndexHtml(options) | Single-SCO course shell HTML | | buildScoIndexHtml(options) | Per-activity launch HTML for SCORM 2004 | | scoLaunchPath(activityId) | Relative launch path (sco/<id>/index.html) | | buildRuntimeConfig(options) | Config object passed to safeJsonForHtml | | collectFiles(courseDir, baseDir) | Course assets for packaging (respects skip rules) | | shouldSkipCourseFile(rel) | Whether a relative path is omitted from exports | | buildManifestFileList(courseFiles) | File list for imsmanifest.xml | | safeJsonForHtml(value) | JSON safe for <script type="application/json"> blocks | | courseSlug(manifest) | Stable slug for ZIP names and manifest identifiers | | ExportTarget | "scorm12" | "scorm2004" | "standalone" |

PackageOptions

| Field | Description | |-------|-------------| | courseDir | Course root directory | | manifest | Parsed course.yaml | | outputPath | Destination ZIP path | | target | scorm12, scorm2004, or standalone | | runtimeClientJs | Contents of @lxpack/runtime/client bundle | | runtimeCss | Runtime stylesheet | | componentsJs | Optional @lxpack/components/bundle for component lessons | | assessmentBundle | From buildRuntimeAssessmentBundle() (assessments, keys, configs, feedback) |

What gets packaged

Included

  • Lessons, interactions, assets, and component overrides referenced by the manifest
  • lxpack-runtime.js — browser client bundle
  • lxpack-components.js — when component lessons are used
  • SCORM 1.2 / standalone: root index.html with embedded config
  • SCORM 2004: sco/<activityId>/index.html per activity + imsmanifest.xml

Excluded (shouldSkipCourseFile)

  • course.yaml, lxpack.config.json, .lxpack/
  • assessments/** — author YAML; assessments are embedded in config instead
  • Root index.html if present (packager generates entry pages)

Answer keys and feedback text are only present inside the JSON config block (with < escaped via safeJsonForHtml), not as downloadable files.

Development

From the monorepo root:

pnpm --filter @lxpack/scorm build
pnpm --filter @lxpack/scorm test
pnpm --filter @lxpack/scorm typecheck

Links

License

Apache-2.0