@ocfl/ocfl-fs 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -1
- package/lib/store.js +0 -5
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
# ocfl-
|
|
1
|
+
# ocfl-fs - OCFL implementation using Filesystem storage backend for Node.js
|
|
2
2
|
This is JavaScript/Node.js library to create and interact with Oxford Common File Layout (OCFL) storage and objects within it.
|
|
3
3
|
This package implements the OCFL client that stores storage root and its objects on a locally attached filesystem.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
npm install @ocfl/ocfl-fs
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
The storage and object methods accept an optional fs parameter, which can be any module that implements Node.js fs module API. By default, it will use the built in fs module.
|
|
12
|
+
|
|
13
|
+
const ocfl = require('@ocfl/ocfl-fs');
|
|
14
|
+
const storage = ocfl.storage({root: '/var/data/myocfl'});
|
|
15
|
+
|
|
16
|
+
For example, by passing it memfs (https://www.npmjs.com/package/memfs) the OCFL storage will be created in memory using the memfs module:
|
|
17
|
+
|
|
18
|
+
const ocfl = require('@ocfl/ocfl-fs');
|
|
19
|
+
const fs = require('memfs');
|
|
20
|
+
const storage = ocfl.storage({root: '/var/data/myocfl'}, {fs});
|
|
21
|
+
|
|
22
|
+
For common usage documentation please refer to the [README.md in GitHub](https://github.com/Arkisto-Platform/ocfl-js)
|
package/lib/store.js
CHANGED
|
@@ -18,11 +18,6 @@ class OcflFsStore extends OcflStore {
|
|
|
18
18
|
/** @type {Map<Object, OcflFsStore>} */
|
|
19
19
|
static instances = new Map();
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @param {Object} options
|
|
24
|
-
* @param {typeof fs} [options.fs]
|
|
25
|
-
*/
|
|
26
21
|
// static getInstance({fs = require('fs')} = {}) {
|
|
27
22
|
// let store = OcflFsStore.instances.get(fs);
|
|
28
23
|
// if (!store) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocfl/ocfl-fs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Oxford Common File Layout (OCFL) JS client library for filesystem storage",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -41,10 +41,14 @@
|
|
|
41
41
|
"jsdoc": "^3.6.10",
|
|
42
42
|
"mocha": "^10.0.0",
|
|
43
43
|
"typedoc": "^0.22.15",
|
|
44
|
-
"@ocfl/ocfl-tests": "
|
|
44
|
+
"@ocfl/ocfl-tests": "*"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ocfl/ocfl": "0.
|
|
47
|
+
"@ocfl/ocfl": "0.2.0"
|
|
48
48
|
},
|
|
49
|
-
"files": [
|
|
49
|
+
"files": [
|
|
50
|
+
"index.js",
|
|
51
|
+
"index.mjs",
|
|
52
|
+
"lib"
|
|
53
|
+
]
|
|
50
54
|
}
|