Skip to content

Commit e084edd

Browse files
committed
Updates
1 parent 7e9fa1e commit e084edd

File tree

5 files changed

+119
-188
lines changed

5 files changed

+119
-188
lines changed

icechunk-js/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,26 @@ For WASM builds (or any environment where the built-in backends aren't suitable)
5252

5353
```typescript
5454
const storage = Storage.newCustom({
55-
canWrite: async () => true,
56-
getObjectRange: async ({ path, rangeStart, rangeEnd }) => {
55+
canWrite: async (_err, ) => true,
56+
getObjectRange: async (_err, { path, rangeStart, rangeEnd }) => {
5757
const headers: Record<string, string> = {}
5858
if (rangeStart != null && rangeEnd != null) {
5959
headers['Range'] = `bytes=${rangeStart}-${rangeEnd - 1}`
6060
}
6161
const resp = await fetch(`https://my-bucket.example.com/${path}`, { headers })
6262
return { data: new Uint8Array(await resp.arrayBuffer()), version: { etag: resp.headers.get('etag') ?? undefined } }
6363
},
64-
putObject: async ({ path, data, contentType }) => { /* ... */ },
65-
copyObject: async ({ from, to }) => { /* ... */ },
66-
listObjects: async (prefix) => { /* return [{ id, createdAt, sizeBytes }] */ },
67-
deleteBatch: async ({ prefix, batch }) => { /* return { deletedObjects, deletedBytes } */ },
68-
getObjectLastModified: async (path) => { /* return Date */ },
69-
getObjectConditional: async ({ path, previousVersion }) => { /* ... */ },
64+
putObject: async (_err, { path, data, contentType }) => { /* ... */ },
65+
copyObject: async (_err, { from, to }) => { /* ... */ },
66+
listObjects: async (_err, prefix) => { /* return [{ id, createdAt, sizeBytes }] */ },
67+
deleteBatch: async (_err, { prefix, batch }) => { /* return { deletedObjects, deletedBytes } */ },
68+
getObjectLastModified: async (_err, path) => { /* return Date */ },
69+
getObjectConditional: async (_err, { path, previousVersion }) => { /* ... */ },
7070
})
7171
```
7272

73+
> **Note:** Callbacks use the Node.js error-first convention — the first argument is always `null` (reserved for errors) and the actual arguments follow. Use `_err` to skip it.
74+
7375
This is the primary way to use cloud storage in the browser, where native Rust networking is unavailable. Each callback method maps to an operation on the underlying `Storage` trait. See the exported `Storage*` TypeScript interfaces for the full type signatures.
7476

7577
### Virtual Chunks

icechunk-js/examples/node-cli/package-lock.json

Lines changed: 23 additions & 141 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

icechunk-js/examples/node-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13-
"@earthmover/icechunk": "^2.0.0-alpha.11"
13+
"@earthmover/icechunk": "file:../.."
1414
}
1515
}

icechunk-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@earthmover/icechunk",
3-
"version": "2.0.0-alpha.11",
3+
"version": "2.0.0-alpha.12",
44
"description": "JavaScript/TypeScript bindings for Icechunk",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)