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

lo_event

v0.0.3

Published

Event logging library for the Learning Observer

Downloads

134

Readme

Learning Observer Event Library

This is a module used to stream events into the Learning Observer (and, in the future, potentially other Learning Record Stores). This is in development. The requirements are:

  • We would like to be able to stream events with multiple loggers.
    • In most cases, in practice, we use a websocket logger, with a persistent connection.
    • For occasional events, we support AJAX logging.
    • In addition, for ease-of-debugging, we can print events to the console
    • We are beginning to support a workflow with react integration, which provides for very good observability
  • We follow the general format used in Caliper, xAPI, and Open edX of one JSON object per event
  • We use a free-form JSON format, but encourage following Caliper / xAPI guidelines where convenient
  • We currently support JavaScript, but would like to support other languages in the future

Examples of places where we intentionally diverge from standards:

  • Good events are like onions -- they have layers. We don't assume we can e.g. trust timestamps or authentication from the system generating events, or that we will have all context up-front. Systems can add timestamps, authentication, and similar, much like e.g. SMTP messages being passed between systems.
  • We do need to have a header for metadata + authentication
  • We'd like to be at least sensitive to bandwidth. It's not worth resending data with each event that can be in a header or in update events. A lot of standards have large, cumbersome events (which are not human-friendly, and expensive to store and process)
  • We're a lot more freeform in what we send and accept, since learning contexts can be pretty rich (and technology evolves) in ways which standards don't always keep up with.

Our goal is to simplify compatibility and to maintain compliance where reasonable, but to be more flexible than strict compliance with xAPI or Caliper.

Installation

This package will support browser-based events, Node, and Python.

However, before installing in either environment, we need to download the xAPI components. These components are used to determine the type of events being used.

cd xapi
./download_xapi_json.sh

As a Node package

To use in a separate node project, such as the /extension/writing_process, you need to make the project available on your system.

npm install
npm link

Then from the other node project, run

npm link lo_event

Note: you may need to rerun npm link lo_event after you run npm install at the target location.

If this runs into issues, a more robust way is to run npm pack to create a tarball npm package, and then to npm install that package. This has the downside of requiring a reinstall on every change, which is somewhat cumbersome.

As a Python package

Simply install the package as a normal python module.

pip install .