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

@syllst/xapi

v0.4.2

Published

xAPI profile for language learning - verbs, activity types, extensions, and Zod schemas extending cmi5

Downloads

494

Readme

@syllst/xapi

xAPI vocabulary profile for language learning — verbs, activity types, extensions, and Zod validation schemas extending cmi5.

Overview

This package defines an xAPI vocabulary profile for language learning activities, providing:

  • Verb constants — Standard ADL verbs + 5 new language-learning verbs
  • Activity type constants — Standard types + 12 new language-learning activity types
  • Extension IRIs & schemas — 12 extensions across context, result, and activity categories
  • Zod validation schemas — Type-safe statement fragment validation
  • JSON-LD profile document — Conforming to xAPI Profile spec v1.0

Namespace: https://syllst.dev/xapi/

Installation

pnpm add @syllst/xapi

Usage

Full Import

import {
  VERBS,
  ACTIVITY_TYPES,
  EXTENSIONS,
} from '@syllst/xapi';

const statement = {
  verb: {
    id: VERBS.TRANSCRIBED,
    display: { 'en-US': 'transcribed' },
  },
  object: {
    definition: {
      type: ACTIVITY_TYPES.VOCABULARY_DRILL,
    },
  },
  context: {
    extensions: {
      [EXTENSIONS.TARGET_LANGUAGE]: 'th',
      [EXTENSIONS.CEFR_LEVEL]: 'A1',
    },
  },
};

Subpath Imports (tree-shaking)

import { VERBS } from '@syllst/xapi/verbs';
import { ACTIVITY_TYPES } from '@syllst/xapi/activity-types';
import { EXTENSIONS, ContextExtensionsSchema } from '@syllst/xapi/extensions';
import { VerbSchema, ActivityDefinitionSchema } from '@syllst/xapi/schemas';
import { SYLLST_XAPI_PROFILE } from '@syllst/xapi/profile';

Validation

import {
  EXTENSIONS,
  ContextExtensionsSchema,
  ResultExtensionsSchema,
  ProfileVerbSchema,
} from '@syllst/xapi';

// Validate context extensions (keys are IRI strings)
const ctx = ContextExtensionsSchema.parse({
  [EXTENSIONS.TARGET_LANGUAGE]: 'th',
  [EXTENSIONS.CEFR_LEVEL]: 'A1',
});

// Validate a verb object
const verb = ProfileVerbSchema.parse({
  id: 'https://syllst.dev/xapi/verbs/transcribed',
  display: { 'en-US': 'transcribed' },
});

Verbs

| Verb | IRI | Description | |------|-----|-------------| | TRANSCRIBED | syllst:verbs/transcribed | Wrote a transcription/transliteration | | PRONOUNCED | syllst:verbs/pronounced | Spoke or attempted pronunciation | | TRANSLATED | syllst:verbs/translated | Provided a translation | | PRACTICED | syllst:verbs/practiced | Completed a practice session | | DRILLED | syllst:verbs/drilled | Completed a focused drill exercise |

Plus standard ADL verbs: LAUNCHED, INITIALIZED, COMPLETED, PASSED, FAILED, TERMINATED, ATTEMPTED, ANSWERED, EXPERIENCED, MASTERED.

Activity Types

| Type | Description | |------|-------------| | VOCABULARY_DRILL | Vocabulary practice activity | | CHARACTER_RECOGNITION | Script/character learning | | FLASHCARD_DECK | Flashcard-based review | | TONE_DRILL | Tonal language practice | | TRANSLATION_EXERCISE | Translation task | | LISTENING_COMPREHENSION | Listening activity | | PRONUNCIATION_EXERCISE | Speaking/pronunciation | | READING_COMPREHENSION | Reading activity | | DIALOGUE_PRACTICE | Conversation practice | | GRAMMAR_EXERCISE | Grammar rule application | | WRITING_EXERCISE | Writing/composition | | CULTURAL_NOTE | Cultural context content |

Plus standard ADL types: COURSE, MODULE, LESSON, OBJECTIVE, ASSESSMENT, QUESTION, INTERACTION, CONTENT.

Extensions

Context Extensions

| Extension | Schema | Description | |-----------|--------|-------------| | TARGET_LANGUAGE | BCP 47 string | Language being learned | | SOURCE_LANGUAGE | BCP 47 string | Learner's native language | | CEFR_LEVEL | A1-C2 enum | Proficiency level | | TRANSCRIPTION_SYSTEM | string | Romanization scheme used |

Result Extensions

| Extension | Schema | Description | |-----------|--------|-------------| | PRONUNCIATION_ACCURACY | 0-1 number | Pronunciation score | | TRANSCRIPTION_ACCURACY | 0-1 number | Transcription score |

Activity Extensions

| Extension | Schema | Description | |-----------|--------|-------------| | TARGET_WORD | non-empty string | Word being practiced | | TRANSCRIPTION | non-empty string | Romanized transcription | | TRANSLATION | non-empty string | Translation text | | WORD_CLASS | non-empty string | Part of speech | | CHARACTER_TYPE | consonant | vowel | tone-mark | Character category | | DIFFICULTY | beginner | intermediate | advanced | Difficulty level |

Complements (does not replace)

  • @xapi/xapi — HTTP client for sending statements to an LRS
  • @xapi/cmi5 — cmi5 AU launch lifecycle runtime

This package provides the vocabulary (IRIs, types, schemas). Use it alongside an xAPI client to construct and send statements.

Development

pnpm test        # Run tests (99 tests)
pnpm build       # Build TypeScript
pnpm typecheck   # Type check

License

MIT