scorm-promised

1.1.8 • Public • Published

SCORM API Wrapper

npm npm bundle size NPM

Currently WIP

This simple SCORM API wrapper is designed to give developers a simple interface to the SCORM 1.2 API. This library is small and simple. It is tree shaking friendly. Only import the functions you are using.

Installation

Install using npm and webpack/rollup etc.

npm install scorm-promised

Then functions can then be imported and used.

import { init, get, set } from 'scorm-promised';

Usage

init

Before using the library you must initialise the module. This will find the SCORM API in the window and begin the session.

import { init } from 'scorm-promised';

init().then(() => console.log('Init library'));

set

import { set } from 'scorm-promised';

set('cmi.suspend_data', 'example')
    .then(() => console.log('Value set'));

get

import { get } from 'scorm-promised';

get('cmi.suspend_data')
    .then(val => console.log(val));

terminate

import { terminate } from 'scorm-promised';

terminate().then(() => console.log('API Terminated'));

getErrorCode

import { getErrorCode } from 'scorm-promised';

getErrorCode().then(code => console.log(code));

Readme

Keywords

none

Package Sidebar

Install

npm i scorm-promised

Weekly Downloads

1

Version

1.1.8

License

MIT

Unpacked Size

10.9 kB

Total Files

10

Last publish

Collaborators

  • samhornsey