r2-fs 0.1.0 → 0.1.1
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 +0 -26
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -58,32 +58,6 @@ export default {
|
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
### Alternative: Wrap in a WorkerEntrypoint
|
|
62
|
-
|
|
63
|
-
For service bindings or more complex setups, you can wrap `R2Filesystem` in a WorkerEntrypoint:
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
import { R2Filesystem } from 'r2-fs';
|
|
67
|
-
import type { WorkerFilesystem } from 'worker-fs-mount';
|
|
68
|
-
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
69
|
-
|
|
70
|
-
export class MyFilesystem extends WorkerEntrypoint<Env> implements WorkerFilesystem {
|
|
71
|
-
private fs = new R2Filesystem(this.env.MY_BUCKET);
|
|
72
|
-
|
|
73
|
-
// Required methods (6)
|
|
74
|
-
stat = this.fs.stat.bind(this.fs);
|
|
75
|
-
createReadStream = this.fs.createReadStream.bind(this.fs);
|
|
76
|
-
createWriteStream = this.fs.createWriteStream.bind(this.fs);
|
|
77
|
-
readdir = this.fs.readdir.bind(this.fs);
|
|
78
|
-
mkdir = this.fs.mkdir.bind(this.fs);
|
|
79
|
-
rm = this.fs.rm.bind(this.fs);
|
|
80
|
-
|
|
81
|
-
// Optional methods (2)
|
|
82
|
-
symlink = this.fs.symlink.bind(this.fs);
|
|
83
|
-
readlink = this.fs.readlink.bind(this.fs);
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
61
|
## Features
|
|
88
62
|
|
|
89
63
|
- Full `WorkerFilesystem` interface implementation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "r2-fs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "R2-backed filesystem for Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
|
-
"url": "git+https://github.com/
|
|
37
|
+
"url": "git+https://github.com/danlapid/worker-fs-mount.git",
|
|
38
38
|
"directory": "packages/r2-fs"
|
|
39
39
|
},
|
|
40
40
|
"bugs": {
|
|
41
|
-
"url": "https://github.com/
|
|
41
|
+
"url": "https://github.com/danlapid/worker-fs-mount/issues"
|
|
42
42
|
},
|
|
43
|
-
"homepage": "https://github.com/
|
|
43
|
+
"homepage": "https://github.com/danlapid/worker-fs-mount/tree/main/packages/r2-fs#readme",
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"worker-fs-mount": "workspace:*"
|
|
46
46
|
},
|