Giter VIP home page Giter VIP logo

tincanjs's Introduction

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.

tincanjs's People

Contributors

brianjmiller avatar brianrogers avatar bscscorm avatar davidells avatar ervinmagic avatar fishhooks avatar garemoko avatar grahamgoudeau avatar limikael avatar rachelarmstrong avatar usernolan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.