1.0.82 • Published 4 months ago

r2-shared-js v1.0.82

Weekly downloads
265
License
BSD-3-Clause
Repository
github
Last release
4 months ago

NodeJS / TypeScript Readium-2 "shared" models

NodeJS implementation (written in TypeScript) of core models for the Readium2 architecture ( https://github.com/readium/architecture/ ).

License

Build status

NPM David

Changelog

Prerequisites

1) https://nodejs.org NodeJS >= 8, NPM >= 5 (check with command line node --version and npm --version) 2) OPTIONAL: https://yarnpkg.com Yarn >= 1.0 (check with command line yarn --version)

GitHub repository

https://github.com/readium/r2-shared-js

There is no github.io site for this project (no gh-pages branch).

NPM package

https://www.npmjs.com/package/r2-shared-js

Command line install:

npm install r2-shared-js OR yarn add r2-shared-js

...or manually add in your package.json:

  "dependencies": {
    "r2-shared-js": "latest"
  }

The JavaScript code distributed in the NPM package is usable as-is (no transpilation required), as it is automatically-generated from the TypeScript source.

Several ECMAScript flavours are provided out-of-the-box: ES5, ES6-2015, ES7-2016, ES8-2017:

https://unpkg.com/r2-shared-js/dist/

(alternatively, GitHub mirror with semantic-versioning release tags: https://github.com/edrlab/r2-shared-js-dist/tree/develop/dist/ )

The JavaScript code is not bundled, and it uses require() statement for imports (NodeJS style).

More information about NodeJS compatibility:

http://node.green

Note that web-browser Javascript is currently not supported (only NodeJS runtimes).

The type definitions (aka "typings") are included as *.d.ts files in ./node_modules/r2-shared-js/dist/**, so this package can be used directly in a TypeScript project.

Example usage:

// from index file
import { Publication } from "r2-shared-js/dist/es5/src";

// ES5 import (assuming node_modules/r2-shared-js/):
import { Publication } from "r2-shared-js/dist/es5/src/models/publication";

// ... or alternatively using a convenient path alias in the TypeScript config (+ WebPack etc.):
import { Publication } from "@r2-shared-js/models/publication";

Dependencies

https://david-dm.org/readium/r2-shared-js

A package-lock.json is provided (modern NPM replacement for npm-shrinkwrap.json).

A yarn.lock file is currently not provided at the root of the source tree.

Continuous Integration

TODO (unit tests?) https://travis-ci.org/readium/r2-shared-js

Badge: [![Travis](https://travis-ci.org/readium/r2-shared-js.svg?branch=develop)](https://travis-ci.org/readium/r2-shared-js)

Version(s), Git revision(s)

NPM package (latest published):

https://unpkg.com/r2-shared-js/dist/gitrev.json

Alternatively, GitHub mirror with semantic-versioning release tags:

https://raw.githack.com/edrlab/r2-shared-js-dist/develop/dist/gitrev.json

Developer quick start

Command line steps (NPM, but similar with YARN):

1) cd r2-shared-js 2) git status (please ensure there are no local changes, especially in package-lock.json and the dependency versions in package.json) 3) rm -rf node_modules (to start from a clean slate) 4) npm install, or alternatively npm ci (both commands initialize the node_modules tree of package dependencies, based on the strict package-lock.json definition) 5) npm run build:all (invoke the main build script: clean, lint, compile) 6) ls dist (that's the build output which gets published as NPM package) 7) npm run cli PATH_TO_PACKED_OR_EXPLODED_EPUB PATH_TO_OUTPUT_FOLDER OPTIONAL_DECRYPT_KEY (to parse a publication and convert it to a Readium2 manifest with extracted resources, paths can be relative or absolute) 8) npm run cli ./misc/epubs/wasteland-otf-obf_LCP_dan.lcpl.epub ./misc/epubs/ dan (same as above, working example with built-in sample LCP basic/test profile) 9) npm run cli ./misc/epubs/wasteland-otf-obf_LCP_dan.lcpl.epub ./misc/epubs/ ec4f2dbb3b140095550c9afbbb69b5d6fd9e814b9da82fad0b34e9fcbe56f1cb (same as above, with SHA256 checksum/hex-digest to avoid plain-text passphrase in console) 10) npm run cli https://raw.githubusercontent.com/readium/r2-shared-js/develop/misc/epubs/wasteland-otf-obf_LCP_dan.lcpl.epub ./misc/epubs/ dan (same as above, but with a remote HTTP URL)

Daisy Integration

Daisy

Documentation

TODO

1.0.79

6 months ago

1.0.78

6 months ago

1.0.80

5 months ago

1.0.82

4 months ago

1.0.81

5 months ago

1.0.77

8 months ago

1.0.76

8 months ago

1.0.75

10 months ago

1.0.74

1 year ago

1.0.73

1 year ago

1.0.72

1 year ago

1.0.71

1 year ago

1.0.69

2 years ago

1.0.68

2 years ago

1.0.70

2 years ago

1.0.66

2 years ago

1.0.67

2 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.60

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.55

3 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

5 years ago

1.0.46

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.45

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-alpha.6

7 years ago

1.0.0-alpha.5

7 years ago

1.0.0-alpha.4

7 years ago

1.0.0-alpha.3

7 years ago

1.0.0-alpha.2

7 years ago

1.0.0-alpha.1

7 years ago