Registry / storage / transferable-object

transferable-object

JSON →
library0.0.22jsnpmunverified

A library for importing and exporting database contents from Cloudflare Durable Objects with SQLite storage. The current stable version is 0.0.22, released as an early-stage package with frequent updates. It enables cross-DO data transfer using streaming SQL cursors, with decorator-based or manual integration patterns. Key differentiators: relies on the companion package remote-sql-cursor, uses Basic Auth with optional read-only public access, and supports cloning between DOs.

npm install transferable-object
INSTALL
IMPORT
SIG · TRANSFERABLE-OBJEC
T
transferable-object
storagejavascriptv0.0.22
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Transferable
import { Transferable } from 'transferable-object'
import Transferable from 'transferable-object'
Named export; default import is incorrect.
Transfer
import { Transfer } from 'transferable-object'
const { Transfer } = require('transferable-object')
ESM-only package; CommonJS require not supported.
clone
import { clone } from 'transferable-object'
import { clone } from 'remote-sql-cursor'
clone is exported from transferable-object, not remote-sql-cursor.

Shows how to decorate a DO for transferability and clone data between two DOs.

import { Streamable } from 'remote-sql-cursor'; import { Transferable, clone } from 'transferable-object'; @Streamable() @Transferable({ secret: 'user:pass' }) export class MyDurableObject extends DurableObject { // Your DO code } // Clone a DO's data to another DO await clone( 'https://source-do-url.example.com', 'https://dest-do-url.example.com', { clearOnImport: true, exportBasicAuth: 'user:pass', importBasicAuth: 'user:pass', } );
Debug
Known issues
breaking@Streamable decorator is required at the source DO, and the DO must be exposed over fetch for transfers to work.
fix
Add @Streamable() decorator from 'remote-sql-cursor' and ensure fetch handler is implemented.
affects: >=0.0.1
deprecatedImport paths may change as the package is pre-1.0; breaking changes possible.
fix
Pin to a specific version and review changelog before upgrading.
affects: <1.0.0
gotchaBasic Auth secret is required unless isReadonlyPublic is true. Missing auth leads to unauthorized responses.
fix
Always provide secret in options or set isReadonlyPublic: true for public read access.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Module not found: Can't resolve 'remote-sql-cursor'
remote-sql-cursor is a required peer dependency not installed.
fix
Run 'npm install remote-sql-cursor'
TypeError: Class extends value undefined is not a constructor or null
Missing or incorrect decorator on Durable Object class.
fix
Ensure @Streamable() decorator is applied and properly imported.
TypeError: Cannot read properties of undefined (reading 'fetch')
Durable Object does not expose a fetch method needed for transfer endpoints.
fix
Add an async fetch(request) method to your DO class.
Upgrade
Version history
0.0.22latest on npm
Audit
Dependencies
remote-sql-cursorrequiredRequired for the @Streamable decorator and streaming SQL cursor functionality.
Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
1
Resources
transferable-object — npm install transferable-object · libregistry