{"id":28697590,"url":"https://github.com/edrlab/r2-shared-js","last_synced_at":"2025-06-14T10:04:13.837Z","repository":{"id":29625230,"uuid":"113779457","full_name":"edrlab/r2-shared-js","owner":"edrlab","description":"Shared models for Readium Desktop","archived":false,"fork":false,"pushed_at":"2025-02-26T08:03:00.000Z","size":24812,"stargazers_count":11,"open_issues_count":18,"forks_count":13,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2025-06-09T18:53:32.340Z","etag":null,"topics":["readium"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edrlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-10T20:04:38.000Z","updated_at":"2025-05-07T17:07:05.000Z","dependencies_parsed_at":"2023-07-17T06:21:45.308Z","dependency_job_id":"b04cd976-d08e-4562-9f2e-54e18489d780","html_url":"https://github.com/edrlab/r2-shared-js","commit_stats":{"total_commits":461,"total_committers":6,"mean_commits":76.83333333333333,"dds":0.06507592190889366,"last_synced_commit":"45e520acec9a3c7ce997d136bb3b1b2f80fb513b"},"previous_names":["edrlab/r2-shared-js","readium/r2-shared-js"],"tags_count":89,"template":false,"template_full_name":null,"purl":"pkg:github/edrlab/r2-shared-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrlab%2Fr2-shared-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrlab%2Fr2-shared-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrlab%2Fr2-shared-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrlab%2Fr2-shared-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edrlab","download_url":"https://codeload.github.com/edrlab/r2-shared-js/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrlab%2Fr2-shared-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259364643,"owners_count":22846523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["readium"],"created_at":"2025-06-14T10:04:12.149Z","updated_at":"2025-06-14T10:04:13.831Z","avatar_url":"https://github.com/edrlab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeJS / TypeScript Readium-2 \"shared\" models\n\nNodeJS implementation (written in TypeScript) of core models for the Readium2 architecture ( https://github.com/readium/architecture/ ).\n\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](/LICENSE)\n\n## Build status\n\n[![NPM](https://img.shields.io/npm/v/r2-shared-js.svg)](https://www.npmjs.com/package/r2-shared-js) [![David](https://david-dm.org/readium/r2-shared-js/status.svg)](https://david-dm.org/readium/r2-shared-js)\n\n[Changelog](/CHANGELOG.md)\n\n## Prerequisites\n\n1) https://nodejs.org NodeJS \u003e= 8, NPM \u003e= 5 (check with command line `node --version` and `npm --version`)\n2) OPTIONAL: https://yarnpkg.com Yarn \u003e= 1.0 (check with command line `yarn --version`)\n\n## GitHub repository\n\nhttps://github.com/readium/r2-shared-js\n\nThere is no [github.io](https://readium.github.io/r2-shared-js) site for this project (no [gh-pages](https://github.com/readium/r2-shared-js/tree/gh-pages) branch).\n\n## NPM package\n\nhttps://www.npmjs.com/package/r2-shared-js\n\nCommand line install:\n\n`npm install r2-shared-js`\nOR\n`yarn add r2-shared-js`\n\n...or manually add in your `package.json`:\n```json\n  \"dependencies\": {\n    \"r2-shared-js\": \"latest\"\n  }\n```\n\nThe JavaScript code distributed in the NPM package is usable as-is (no transpilation required), as it is automatically-generated from the TypeScript source.\n\nSeveral ECMAScript flavours are provided out-of-the-box: ES5, ES6-2015, ES7-2016, ES8-2017:\n\nhttps://unpkg.com/r2-shared-js/dist/\n\n(alternatively, GitHub mirror with semantic-versioning release tags: https://github.com/edrlab/r2-shared-js-dist/tree/develop/dist/ )\n\nThe JavaScript code is not bundled, and it uses `require()` statement for imports (NodeJS style).\n\nMore information about NodeJS compatibility:\n\nhttp://node.green\n\nNote that web-browser Javascript is currently not supported (only NodeJS runtimes).\n\nThe 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.\n\nExample usage:\n\n```javascript\n// from index file\nimport { Publication } from \"r2-shared-js/dist/es5/src\";\n\n// ES5 import (assuming node_modules/r2-shared-js/):\nimport { Publication } from \"r2-shared-js/dist/es5/src/models/publication\";\n\n// ... or alternatively using a convenient path alias in the TypeScript config (+ WebPack etc.):\nimport { Publication } from \"@r2-shared-js/models/publication\";\n```\n\n## Dependencies\n\nhttps://david-dm.org/readium/r2-shared-js\n\nA [package-lock.json](https://github.com/readium/r2-shared-js/blob/develop/package-lock.json) is provided (modern NPM replacement for `npm-shrinkwrap.json`).\n\nA [yarn.lock](https://github.com/readium/r2-shared-js/blob/develop/yarn.lock) file is currently *not* provided at the root of the source tree.\n\n## Continuous Integration\n\nTODO (unit tests?)\nhttps://travis-ci.org/readium/r2-shared-js\n\nBadge: `[![Travis](https://travis-ci.org/readium/r2-shared-js.svg?branch=develop)](https://travis-ci.org/readium/r2-shared-js)`\n\n## Version(s), Git revision(s)\n\nNPM package (latest published):\n\nhttps://unpkg.com/r2-shared-js/dist/gitrev.json\n\nAlternatively, GitHub mirror with semantic-versioning release tags:\n\nhttps://raw.githack.com/edrlab/r2-shared-js-dist/develop/dist/gitrev.json\n\n## Developer quick start\n\nCommand line steps (NPM, but similar with YARN):\n\n1) `cd r2-shared-js`\n2) `git status` (please ensure there are no local changes, especially in `package-lock.json` and the dependency versions in `package.json`)\n3) `rm -rf node_modules` (to start from a clean slate)\n4) `npm install`, or alternatively `npm ci` (both commands initialize the `node_modules` tree of package dependencies, based on the strict `package-lock.json` definition)\n5) `npm run build:all` (invoke the main build script: clean, lint, compile)\n6) `ls dist` (that's the build output which gets published as NPM package)\n7) `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)\n8) `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)\n9) `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)\n10) `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)\n\n## Daisy Integration\n[Daisy](/daisy.md)\n\n## Documentation\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedrlab%2Fr2-shared-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedrlab%2Fr2-shared-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedrlab%2Fr2-shared-js/lists"}