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

tincanjs

v0.50.0

Published

Experience API (Tin Can API) Library

Downloads

11,794

Readme

A JavaScript library for implementing the Experience API (Tin Can API).

Build Status GitHub release npm license

For hosted API documentation, basic usage instructions, supported version listing, etc. visit the main project website at:

http://rusticisoftware.github.io/TinCanJS/

For more information about the Experience API visit:

http://experienceapi.com/

Browser Usage

TinCanJS is available via npm and Bower.

The browser environment is well tested and supports two kinds of Cross Origin requests which is sufficient to cover most versions of Chrome, FireFox, Safari as well as IE 8+. IE 6+ are supported for non-CORS (because they don't support it).

Include one of build/tincan-min.js or build/tincan.js as follows:

<script src="build/tincan-min.js"></script>

Node.js Usage

TinCanJS is available via npm.

The Environment/Node.js wrapper used in this version has a dependency on the 'xhr2' module which is also available via npm. It is used to allow the interfaces to the underlying LRS requests to have the same API. As such currently there is no support for synchronous requests when using this environment.

Install via:

npm install tincanjs

And within code:

var TinCan = require('tincanjs');

Environments

Implementing a new Environment should be straightforward and requires overloading a couple of methods in the library. There are currently two examples, Environment/Browser and Environment/Node.

Attachment Support

Sending and retrieving statements with attachments via the multipart/mixed request/response cycle works end to end with binary attachments in Node.js 4+ and in the typical modern browsers: Chrome 53+, Firefox 48+, Safari 9+, IE 10+ (current versions at time of implementation, older versions may work without changes but have not been tested). Attachments without included content (those using only the fileUrl property) should be supported in all environments supported by the library.

Several polyfills (TypedArrays, ArrayBuffer w/ slice, Blob, TextDecoder/TextEncoder) are needed to support various browser versions, if you are targeting a recent enough set of browsers you can reduce the overall size of the built library by commenting out those polyfills in the Gruntfile.js file and building yourself.