Registry / storage / unstorage-nightly

unstorage-nightly

JSON →
library2.0.0-20260505-132234-7a0557fjsnpmunverified

Nightly release of Unstorage, an async key-value storage API with multi-driver mounting, watching, and metadata support. Current nightly version 2.0.0-20260505-132234-7a0557f. Unstorage ships a tiny core (~2kB) with built-in drivers for memory, filesystem, Redis, Azure, AWS, and more. It auto-serializes JSON, supports binary values, snapshots, and a built-in HTTP server. Designed for browser, Node.js, and Workers. Release cadence: nightly build from main branch.

npm install unstorage-nightly
INSTALL
IMPORT
SIG · UNSTORAGE-NIGHTLY
U
unstorage-nightly
storagejavascriptv2.0.0-20260505-132234-7a0557f
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.

createStorage
import { createStorage } from 'unstorage-nightly'
const createStorage = require('unstorage-nightly')
Module is ESM-only; named export.
defineDriver
import { defineDriver } from 'unstorage-nightly'
Used for creating custom drivers.
builtinDrivers
import { builtinDrivers } from 'unstorage-nightly'
Object containing all built-in driver factories.
default
import unstorage from 'unstorage-nightly'
import { default as unstorage } from 'unstorage-nightly'
Default export is an alias for `createStorage`.

Demonstrates creating a storage instance, setting and getting items, mounting a Redis driver with prefix, and watching for changes.

import { createStorage } from 'unstorage-nightly'; const storage = createStorage({ // use memory driver by default }); // store and retrieve a value await storage.setItem('test:key', { hello: 'world' }); const value = await storage.getItem('test:key'); console.log(value); // { hello: 'world' } // use a prefix driver to mount a different driver import redisDriver from 'unstorage-nightly/drivers/redis'; import { defineDriver } from 'unstorage-nightly'; const storageWithRedis = createStorage({ driver: redisDriver({ host: process.env.REDIS_HOST ?? 'localhost', port: process.env.REDIS_PORT ?? 6379, password: process.env.REDIS_PASSWORD ?? '', }), prefix: 'app:', }); await storageWithRedis.setItem('user:1', { name: 'Alice', score: 100 }); // watch for changes const unwatch = await storage.watch((event, key) => { console.log(`Event: ${event}, Key: ${key}`); }); // later stop watching unwatch();
Debug
Known issues
breakingunstorage-nightly is a nightly build of unstorage; APIs may change daily without notice. Do not use in production without pinning to a specific nightly version or the stable unstorage package.
fix
Use the stable unstorage package (npm install unstorage) for production, or pin to a specific nightly build in package.json.
affects: >=2.0.0-0
deprecatedThe 'mount' method in previous versions (<1.0) has been replaced with driver mounting via createStorage options.
fix
Use createStorage({ driver: someDriver }) instead of storage.mount().
affects: <1.0.0
gotchaAll drivers listed in peerDependencies are optional; install only the ones you need. Leaving them installed may increase bundle size unnecessarily.
fix
Use install-peerdeps to install only required drivers.
affects: >=2.0.0
gotchaStorage keys with slashes ('/') are automatically normalized; 'foo:bar' and '/foo/bar' are equivalent. This may cause unexpected collisions.
fix
Use consistent key format (prefer colon notation).
affects: >=1.0.0
gotchaThe default in-memory driver is not persistent; data is lost on process exit. For persistence in Node.js, use the filesystem driver or a remote driver like redis.
fix
Explicitly configure a persistent driver.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'unstorage-nightly' or its corresponding type declarations.
Package not installed or missing type definitions.
fix
Run `npm install unstorage-nightly` and ensure your tsconfig includes node_modules.
Error: [unstorage] Unknown driver: 'redis'
Trying to use a built-in driver without installing the required peer dependency.
fix
Install the corresponding peer dependency, e.g., `npm install ioredis` for Redis driver.
TypeError: storage.watch is not a function
Calling watch on a driver that does not support watching (e.g., HTTP driver).
fix
Ensure you are using a driver that supports watch (e.g., memory, fs, redis).
Error: Cannot read properties of undefined (reading 'getItem')
Storage instance not awaited or incorrectly imported.
fix
Ensure you use `const storage = createStorage(...)` and that imports are correct: `import { createStorage } from 'unstorage-nightly'`.
Upgrade
Version history
2.0.0-20260505-132234-7a0557flatest on npm
Audit
Dependencies
@azure/app-configurationoptionalOptional driver for Azure App Configuration
@azure/cosmosoptionalOptional driver for Azure Cosmos DB
@azure/data-tablesoptionalOptional driver for Azure Data Tables
@azure/identityoptionalOptional Azure authentication
@azure/keyvault-secretsoptionalOptional driver for Azure Key Vault Secrets
@azure/storage-bloboptionalOptional driver for Azure Blob Storage
@capacitor/preferencesoptionalOptional driver for Capacitor Preferences
@deno/kvoptionalOptional driver for Deno KV
@netlify/blobsoptionalOptional driver for Netlify Blobs
@planetscale/databaseoptionalOptional driver for PlanetScale
@upstash/redisoptionalOptional driver for Upstash Redis
@vercel/bloboptionalOptional driver for Vercel Blob
@vercel/functionsoptionalOptional integration with Vercel Functions
@vercel/kvoptionalOptional driver for Vercel KV
aws4fetchoptionalOptional driver for AWS
chokidaroptionalOptional file watcher for filesystem driver
db0optionalOptional database driver
idb-keyvaloptionalOptional driver for IndexedDB
ioredisoptionalOptional driver for Redis
lru-cacheoptionalOptional in-memory LRU cache driver
mongodboptionalOptional driver for MongoDB
ofetchoptionalOptional HTTP driver
uploadthingoptionalOptional driver for UploadThing
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources