1.1.8 • Published 3 years ago

scorm-promised v1.1.8

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

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));
1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

4 years ago

1.1.4

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago