Skip to content
No description or website provided.
Branch: master
Clone or download
Latest commit c1aaeed Sep 20, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist The dist build output (npm run build) is now pushed to the source tre… Sep 20, 2018
spec Skip two tests that are currently hard to get working Mar 15, 2018
.eslintrc Initiate a major project restructuring Mar 15, 2018


EPUB3 CFI utility library in JavaScript

This is a software component used by other Readium projects, see


BSD-3-Clause ( )

See license.txt.


Using npm / yarn

npm install readium-cfi-js or yarn add readium-cfi-js


This library is bundled in UMD and ES module formats.

  • CommonJS
const EPUBcfi = require('readium-cfi-js');
  • ES Module
import * as EPUBcfi from 'readium-cfi-js';
  • Globally with window.EPUBcfi
<script src="readium-cfi.umd.js"></script>

Usage in non-browser environments (Node)

Currently not supported as the implementation depends on jQuery and the DOM.

A subset of the API could work without a browser, which may be planned for a future release.



Initial setup:

  • npm install (to download dependencies defined in package.json ... note that the --production option can be used to avoid downloading development dependencies, for example when testing only the pre-built dist folder contents)

Typical workflow:

  • Hack away! (mostly the source code in ./src and ./spec/models )
  • npm run build (to update the output bundles in the dist folder)

Unit tests:

  • npm run test (Karma launcher)

Travis (Continuous Integration):

Bundled outputs

The dist directory contains bundled scripts in two module formats:

UMD - Universal Module Definition

readium-cfi.umd.js (and its associated source-map file), which aggregates all the required code (external library dependencies included, such as jQuery, etc.)

You can include this as CommonJS/AMD or with the global EPUBcfi

Works best for when using Browserify or RequireJS

ES Modules

readium-cfi.esm.js (and its associated source-map file), also aggregates all the required code

Works best for rollup.js or webpack

NPM package

All packages "owned" and maintained by the Readium Foundation are listed here:

You can’t perform that action at this time.