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

@nypl/opds

v0.1.0-alpha.0

Published

OPDS Typescript Models

Downloads

1

Readme

About

This package has both OPDS 1 and OPDS 2 types. The OPDS 1 types are mainly a collection of link relation constants and some JSON that is specific to the Library Simplified Circulation Manager - not formally part of OPDS. The OPDS 2 types are newer and actually represent real OPDS 2 spec.

In the future, this package is not a place to put PJR or Library Simplified specific types, but should conform to the official OPDS spec. The only exception is with profiles we have defined ourselves, such as the PDF profile and the Work profile. In the future, we would like to find a better place to define PJR-specific constants such as link relations and media types.

OPDS 2 Types

The OPDS 2 Typescript type definitions are build to match the OPDS 2.0 Draft Spec. It is primarily based on the JSON schemas stored in the Readium Github:

The OPDS 2.0 spec is based on the same model as the Readium Webpub Manifest, but extends it to allow an OPDS document to represent a Feed or a Publication. The primary difference between a Webpub Manifest and a Publication is that a Webpub Manifest must have a readingOrder: the reasources needed to read the publication need to be listed directly in the manifest. A Publication represents a more abstract concept, and might not be directly readable. Thus it doesn't need the readingOrder.

Extensions & Modules

The OPDS 2.0 and Webpub Manifest spec allow for extensions. An extension specifies additional metadata, link properties and collection roles that a Publication or Feed can have. To use an extension, the Publication should declare that it conforms to a profile using the metadata.conformsTo property. We have implemented the following profiles:

  1. Epub Profile - use the OPDS2.EpubWebpubManifest type to represent a webpub that conforms to the Epub profile.
  2. Encryption module - any resource can be declared as encrypted. You don't need to declare conformance with a profile. I'm not exactly sure what the difference between a module and an extension is meant to be in the spec, but there is no way to specify that the module is used, so it's allowed on all resources.

Not implemented

We have not implemented the following profiles yet:

  • Presentation hints module - both the EPUB profile and this module allow the addition of presentation hints, sometimes in a conflicting way. This Github discussion indicates that the presentation hints module will likely be deprecated or renamed to be Divina-specific. Thus, we don't plan to implement it at the moment.
  • Audiobook profile - we will implement when we get there.

Other future improvements

  1. Improve the range of media types defined. We can fill this in as needed.
  2. Figure out a way to add LibrarySimplified and future Project R specific types on top of the base OPDS2 types. For example, LibrarySimplified defines an additional "revoke" role for an acquisition link.