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 🙏

© 2024 – Pkg Stats / Ryan Hefner

scormint

v0.2.0

Published

A SCORM 1.2 & 2004 API wrapper

Downloads

5

Readme

SCORMint

A simple SCORM interface written in ES6, heavily based on Pipwerks implementation.

Docs

Installation

npm install scormint --save

Usage

import SCORM from 'scormint';

const scorm = new SCORM();

// Initializing the connection with the API
scorm.initialize();

// Setting a field (suspend_data, in this case) in the API
scorm.set('cmi.suspend_data', 'Hello World!');

// Setting the lesson_status as complete
scorm.status('complete');

// Commiting the changes
scorm.save();

SCORMint API docs

constructor(version)

const scorm = new SCORM('1.2');

version

Type: undefined or String

The desired SCORM API version. Leave blank for autodetect (priorize SCORM 1.2).

initialize()

Connects and initialize the API

terminate()

Terminate the connection with the API

status(status)

Gets or sets the lesson status If status is ommited, returns the lesson status. Sets the status otherwise.

status

Type: undefined or String

The status of the lesson

get(key)

Gets a field from the API

key

Type: String

The cmi key of the field

set(key, value)

Sets a field in the API

key

Type: String

The cmi key of the field

value

Type: any

The value to persist. Any object passed here will be cast to string.

save()

Persists/Commits the changes in the API

lastErrorCode()

Gets the last error reported by the API

errorString(code)

Gets the text representation of the error code

value

Type: String

The code returned by lastErrorCode()

version

The selected version of the SCORM API

connected

The status of the connection true if connected to the SCORM API, false otherwise

updateStatusAfterInitialize

Determines if the lesson/completion status should be changed from 'not attempted' to 'incomplete' after initialization Defaults to true

updateStatusBeforeTerminate

Determines if the exit status should be set as 'suspend' or 'logout' (depending on lesson/completion status) before terminate Defaults to true

SCORM.VERSION_1_2

1.2

SCORM.VERSION_2004

2004