Registry / database / cloudly-storage

cloudly-storage

JSON →
library0.10.22jsnpmunverified

Cloudflare Workers Storage library (v0.10.22) providing a simplified typed interface for KV, Durable Objects, and R2. Designed for Cloudflare Workers ecosystem with strict TypeScript support, minimal overhead, and first-class integration with other Cloudly libraries. Releases follow semantic versioning with monthly cadence. Key differentiator: unified storage abstraction across CF storage primitives with type-safety and minimal boilerplate.

npm install cloudly-storage
INSTALL
IMPORT
SIG · CLOUDLY-STORAGE
C
cloudly-storage
databasejavascriptv0.10.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.

Storage
✓ import { Storage } from 'cloudly-storage'
✗ import Storage from 'cloudly-storage'
Named export only; no default export.
KVStorage
✓ import { KVStorage } from 'cloudly-storage'
✗ import { KV } from 'cloudly-storage'
Use KVStorage, not KV.
DurableObjectStorage
✓ import { DurableObjectStorage } from 'cloudly-storage'
✗ import { DOStorage } from 'cloudly-storage'
Full name required.

Initializes a unified storage instance, puts and gets a value across KV, Durable Objects, and R2.

import { Storage } from 'cloudly-storage'; const storage = new Storage({ kv: { namespace: process.env.KV_NAMESPACE }, durableObject: { namespace: process.env.DO_NAMESPACE }, r2: { bucket: process.env.R2_BUCKET }, }); async function handleRequest() { await storage.put('key', { value: 'data' }); const result = await storage.get('key'); console.log(result?.value); } handleRequest();
Debug
Known issues
breakingv0.10.0 renames `DurableObjectStorage` to `DurableObjectStorage` (was `DOStorage`).
fix
Update imports from `DOStorage` to `DurableObjectStorage`.
affects: >=0.10.0
deprecatedv0.8.0 deprecates `Storage.set` in favor of `put`.
fix
Use `storage.put(...)` instead of `storage.set(...)`.
affects: >=0.8.0 <0.10.0
gotchaStorage instances require explicit namespace/bucket configuration; missing namespace throws at runtime.
fix
Ensure environment variables or config object includes required properties.
affects: >=0.1.0
gotchaThe library is ESM-only; CommonJS `require` will fail.
fix
Use `import` syntax.
affects: >=0.10.0
breakingv0.9.0 changes `get` return type from `T | null` to `T | undefined`.
fix
Check for `undefined` instead of `null`.
affects: >=0.9.0
Errors
Common errors & fixes
Module not found: 'cloudly-storage'
Package not installed or ESM-only requiring CommonJS import
fix
Run `npm install cloudly-storage` and use `import` syntax.
TypeError: storage.get is not a function
Storage instance not initialized with configuration
fix
Provide correct namespace/bucket in constructor.
Error: Namespace is required for KV storage
Missing `kv.namespace` in config
fix
Set `KV_NAMESPACE` environment variable or pass namespace in config.
Upgrade
Version history
0.10.22latest on npm
Audit
Dependencies
@cloudflare/workers-typesoptionalTypeScript types for Workers runtime APIs
cloudly-storageoptionalself-reference for clarity
Agent activity
13 hits · last 30 days
node
9
Amazon
2
OpenAI (training)
1
Resources
cloudly-storage — npm install cloudly-storage · libregistry