@ocfl/ocfl-fs
Stores and versions digital objects in an Oxford Common File Layout (OCFL) storage root on a local file system.
Start with createStorageRoot for a new storage root or openStorageRoot for an existing one. A
StorageRoot opens, creates, lists and removes objects. An OcflObject gives each version’s files,
and update adds a version from a Draft. A failure the library detects is an OcflError; test its code.
File system errors, such as ENOSPC, pass through untouched, unless they leave a write needing recovery: then the error is
RECOVERY_NEEDED, with the file system error as its cause.
Example
Section titled “Example”import { openStorageRoot } from '@ocfl/ocfl-fs';
const root = await openStorageRoot('/srv/ocfl');const object = await root.open('arcp://name,corpus/item/1');await object.update({ message: 'Add transcript', user: { name: 'Alice' } }, async (draft) => { await draft.write('transcript.txt', transcript);});Classes
Section titled “Classes”Interfaces
Section titled “Interfaces”- ByteRange
- Draft
- FixityOptions
- FixityProblem
- FixityProgress
- FlatDirectLayoutConfig
- HashAndIdNTupleLayoutConfig
- HashedNTupleLayoutConfig
- ImportOptions
- MergeOptions
- OcflFile
- OcflObject
- PathDirectLayoutConfig
- StorageRoot
- UnfinishedWrite
- UpdateOptions
- User
- Version
- VersionDetails
Type Aliases
Section titled “Type Aliases”- DigestAlgorithm
- FixityAlgorithm
- Layout
- LayoutConfig
- ListedObject
- OcflErrorCode
- OcflVersion
- WriteContent