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

vite-plugin-scorm

v0.0.2

Published

A Vite plugin that packages your build output into SCORM-compliant ZIP files. Supports SCORM 1.2 and SCORM 2004 (4th Edition).

Readme

vite-plugin-scorm

A Vite plugin that packages your build output into SCORM-compliant ZIP files. Supports SCORM 1.2 and SCORM 2004 (4th Edition).

Install

npm install vite-plugin-scorm

Requires vite >= 5.0.0 as a peer dependency.

Usage

// vite.config.ts
import { defineConfig } from "vite";
import { scormPackager } from "vite-plugin-scorm";

export default defineConfig({
  plugins: [
    scormPackager({
      courseFile: "src/course.ts",
      target: "both",
    }),
  ],
});

After vite build, SCORM ZIP packages are written to scorm-packages/ (by default).

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | courseFile | string | 'src/course.ts' | Path to course definition file, relative to Vite root | | entry | string | 'index.html' | Entry HTML filename in the build output | | target | '1.2' \| '2004' \| 'both' | 'both' | SCORM version(s) to generate | | outputDir | string | 'scorm-packages' | Output directory for ZIPs, relative to project root | | loadCourse | (root: string) => Promise<CourseMetadata> | Built-in Svelte loader | Custom course metadata loader |

Course Metadata

The plugin reads course metadata from your course definition file. It expects a named export course with this shape:

type CourseMetadata = {
  id: string; // Unique course identifier
  title: string; // Course title
  description?: string; // Optional description
  masteryScore?: number; // Pass threshold 0–100 (SCORM 1.2 only)
  minScore: number; // Minimum possible score
  maxScore: number; // Maximum possible score
};

All fields are validated at build time. id, title, minScore, and maxScore are required. masteryScore must be between 0 and 100 if provided.

Custom Course Loader

By default, the plugin uses Vite's build API to bundle and evaluate the course file. This works with Svelte projects out of the box (.svelte and .svx imports are shimmed).

For non-Svelte projects or custom setups, provide a loadCourse function:

scormPackager({
  loadCourse: async (root) => ({
    id: "my-course",
    title: "My Course",
    minScore: 0,
    maxScore: 100,
  }),
});

Output

The plugin runs during the closeBundle hook. For each target version, it:

  1. Generates an imsmanifest.xml conforming to the SCORM spec
  2. Bundles the manifest with all files from the build output into a ZIP
  3. Writes the ZIP to {outputDir}/{slugified-course-id}-{suffix}.zip

With target: 'both', you get two files: *-scorm12.zip and *-scorm2004.zip.

Limitations

  • Only SCORM 1.2 and SCORM 2004 4th Edition are supported
  • Single SCO per package (one organization, one item)
  • No sequencing or navigation rules in the manifest
  • All build output files are included — no selective file inclusion/exclusion
  • masteryScore is only written to the SCORM 1.2 manifest
  • Course metadata is static (defined at build time)

Exports

// Main plugin
import { scormPackager } from "vite-plugin-scorm";

// Types
import type {
  ScormPackagerOptions,
  CourseMetadata,
  DistributionFile,
  FormatHandler,
  FormatRegistry,
  FormatContext,
  FormatResult,
} from "vite-plugin-scorm";