scorm-review
v1.3.0
Published
Convert SCORM zip packages into self-contained review HTML files
Maintainers
Readme
scorm-review
Inject the coreview annotation tool into any SCORM package — no server, no browser extension, no setup needed on the reviewer's end.
Table of Contents
- What it does
- How it works
- Requirements
- Installation
- Usage
- Output explained
- What gets changed inside your package
- How to send to a reviewer
- CLI reference
- How it works internally
- Project structure
- Building from source
- Troubleshooting
What it does
scorm-review takes a SCORM package (zip file, unzipped folder, or a standalone HTML file) and injects the coreview annotation tool into it. The output is a new file your reviewers can open in any browser and leave comments directly on the slides — no install needed on their end.
Before: my-course.zip ← plain SCORM package
After: my-course_review.zip ← same package + annotation panel built inReviewers open index.html from the output zip and the annotation sidebar appears automatically.
How it works
- Opens the input (zip, folder, or HTML file)
- Finds the HTML entry point (
index.html) - Injects a
<script>tag referencingcoreview.jsinto that HTML file - Adds
coreview.js(the annotation tool) next to the entry HTML - Saves the modified package as a new zip (or HTML file for single-file input)
The original file is never modified. A new _review file is always created.
Requirements
- Node.js v18 or higher
That's all. No other tools, no browser extensions, no server.
To check your Node.js version:
node --version
# Should print v18.x.x or higherIf you don't have Node.js, download the LTS version from nodejs.org.
Installation
Option A — Use with npx (no install)
Run it directly without installing anything:
npx scorm-review ./my-course.zipnpx is included with Node.js. On first run it fetches the package automatically.
Option B — Install globally
Install once, use from anywhere without the npx prefix:
npm install -g scorm-reviewThen:
scorm-review ./my-course.zipUsage
Convert a SCORM zip
npx scorm-review ./my-course.zipOutput in the same folder:
Input: my-course.zip
Output: C:\path\to\my-course_review.zip
Processing SCORM zip... done.
✓ Created: my-course_review.zip (15.2 MB)Convert a SCORM folder
If your SCORM package is already unzipped:
npx scorm-review ./my-course/The tool walks the folder, finds index.html, injects the annotation tool, and packages everything back into a zip.
Convert a plain HTML file
For a standalone HTML file (not a SCORM package):
npx scorm-review ./page.htmlOutput: page_review.html — the script is embedded inline so no separate coreview.js file is needed.
Specify a custom output path
Use -o or --output to choose where the output file is saved:
npx scorm-review ./my-course.zip -o ./output/my-course_review.zipThe output directory is created automatically if it doesn't exist.
Show help
npx scorm-review --helpOutput explained
| Input | Output file | Notes |
|---|---|---|
| my-course.zip | my-course_review.zip | New zip with coreview.js added and index.html injected |
| my-course/ (folder) | my-course_review.zip | Folder re-zipped with coreview.js added and index.html injected |
| page.html | page_review.html | Single file — script embedded inline |
The output is always saved next to the input file unless you specify -o.
What gets changed inside your package
Only two things change inside the output zip compared to the original:
coreview.jsis added — placed in the same folder asindex.html- One
<script>tag is added toindex.html— injected just before</body>
<!-- Added by scorm-review -->
<script
src="./coreview.js"
data-project="scorm-review"
data-note="Please review all slides. Check layout, wording, and content."
data-start-open="false">
</script>Everything else — folder structure, file names, SCORM manifest, assets — is untouched.
If a coreview.js script tag already exists in the HTML, it is replaced rather than duplicated.
How to send to a reviewer
- Run
scorm-reviewon your SCORM package - Send the
_review.zipto your reviewer (email, shared drive, etc.) - Reviewer unzips it and opens
index.htmlin any modern browser (Chrome, Edge, Firefox, Safari) - The annotation panel appears automatically — they can leave comments on any slide
- They share their annotated session back to you (via the coreview export feature)
No installs, no accounts, no browser extensions required on the reviewer's side.
CLI reference
scorm-review <input> [options]
Arguments:
<input> Path to a .zip file, a folder, or a .html file
Options:
-o, --output <path> Custom output file path (default: <name>_review.zip next to input)
-h, --help Show help message
Supported input types:
.zip SCORM package zip file
folder/ Unzipped SCORM package directory
.html / .htm Plain HTML file
Exit codes:
0 Success
1 Error (path not found, unsupported file type, no HTML entry point found)How it works internally
Entry point detection
The tool looks for the HTML entry point in this priority order:
index.htmlat the root of the zip/folderIndex.htmlat the root (case-insensitive fallback)<subfolder>/index.html— one level deep (common in SCORM packages where content is insidescorm_package/)- Any
.htmlfile anywhere in the package
If no HTML file is found, the tool exits with an error.
Script injection
The <script> tag is injected just before </body>. If the HTML has no </body> tag, the script is appended to the end of the file.
Any existing coreview.js script tags are removed before injecting the new one — so re-running the tool on an already-injected package is safe and idempotent.
coreview.js bundling
coreview.js is baked into the CLI binary at build time using esbuild. This means:
- The CLI is a single file with no runtime file dependencies
- The same version of the annotation tool ships with every release
- No network access is needed at runtime — everything is self-contained
Project structure
scorm-review-cli/
├── src/
│ ├── cli.ts # Entry point — argument parsing, file I/O, orchestration
│ ├── bundler.ts # Core logic — zip handling, HTML injection, folder packing
│ └── bundler-template.ts # Template used during the build to embed coreview.js
├── dist/ # Compiled output (generated by build)
│ └── cli.js # Single-file compiled CLI (published to npm)
├── build.mjs # esbuild build script — compiles + inlines coreview.js
├── tsconfig.json # TypeScript configuration
└── package.jsonKey files
src/cli.ts — Handles all CLI concerns: argument parsing, input validation, calling the right bundler function, and writing the output file. Contains no bundling logic itself.
src/bundler.ts — Contains three exported functions:
bundleScormZip(zipBuffer, coreviewScript)— processes a zip BufferbundleScormFolder(folderPath, coreviewScript)— processes a folder on diskbundlePlainHtml(htmlBuffer, coreviewScript)— processes a standalone HTML file
build.mjs — esbuild script that reads coreview.js from disk, base64-encodes it (or inlines it as a string), and substitutes the __COREVIEW_SCRIPT__ constant at bundle time. The result is dist/cli.js, a single portable file with no external dependencies.
Building from source
# Install dev dependencies
npm install
# Build dist/cli.js
npm run buildThe build script (build.mjs) uses esbuild to:
- Compile TypeScript to JavaScript
- Bundle all imports into a single file
- Inline
coreview.jsas a string constant at build time - Output
dist/cli.jswith the Node.js shebang line
To test the built binary locally:
node dist/cli.js ./samplefolder/sample3.zipTroubleshooting
npx: command not found
Node.js is not installed or not on your PATH. Download from nodejs.org and reinstall.
Error: Path not found: ...
The file or folder you specified doesn't exist at that path. Check for typos, or use the full absolute path:
npx scorm-review "C:\Users\yourname\Desktop\my-course.zip"Error: No HTML entry point found
The zip doesn't contain an index.html. Possible causes:
- You pointed at a zip that isn't a SCORM package
- The SCORM package has a non-standard entry point (e.g.
story.htmlinstead ofindex.html) - The
index.htmlis nested more than one level deep
Try unzipping manually and pointing the tool at the folder that contains index.html:
npx scorm-review ./unzipped-course/Error: Unsupported file type ".pptx"
Only .zip, .html, .htm, and folders are accepted. Other file types are not supported.
Output zip is much larger than the original
This is expected when the original zip used maximum compression. The tool re-compresses with level 6 (balanced), which may produce a slightly larger file compared to an original that was compressed at level 9. The content is identical.
Running the tool again on a _review.zip adds a second injection
Re-running on an already-processed file is safe — the tool removes any existing coreview.js script tag before injecting a new one, so no duplication occurs.
