Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ocfl/ocfl

Language-Research-Technology206GPL-3.0-or-later0.2.2TypeScript support: included

Oxford Common File Layout (OCFL) JS library

ocfl, Oxford Common File Layout, preservation, storage

readme

ocfl-js - Common modules

This is JavaScript/Node.js library to create and interact with Oxford Common File Layout (OCFL) storage and objects within it. This package contains abstract classes definition. Do not use this package directly. To work with an actual OCFL storage and object, use the following concrete implementation:

  • ocfl-fs - File system backend

Extensions

This library by default includes all the community extensions defined in the OCFL Community Extensions page. The implementation is organised in the ocfl-extensions package.

To implement a local extension in this library, first follow the description in that page, then create a function like in the following example:

const ocfl = require(ocfl-fs);
ocfl.extensions['9999-local-test'] = function (Storage, Object) {


}

Implementation

A new data store backend can be implemented by creating a new package with a store class that extends the OcflStore class and implements its methods. Please see the source code of ocfl-fs as an example implementation