Drivers
Driver dependencies
Unstorage itself has no runtime dependencies. Drivers that talk to a third-party library (ioredis, mongodb, @azure/*, ...) import it lazily and dynamically on first use, so you only need to install what the drivers you actually use require. Each driver page lists its own install command.
If your bundler or runtime cannot resolve the dynamic import (or you simply prefer a static top-level import), every such driver accepts a lib option:
import { createStorage } from "unstorage";
import redisDriver from "unstorage/drivers/redis";
import * as ioredis from "ioredis";
const storage = createStorage({
driver: redisDriver({
lib: ioredis, // the module itself
// lib: () => import("ioredis"), // or a (sync/async) function returning it
}),
});
The Azure drivers additionally accept identityLib for @azure/identity, which is only needed when no explicit credential (account key, SAS key or connection string) is given.
Introspecting dependencies
Each driver module exports a DRIVER_DEPENDENCIES object describing what it needs, keyed by the option used to provide it. The same data is aggregated for all built-in drivers as builtinDriverDependencies, so frameworks can check (or install) what a configured driver requires:
import { builtinDriverDependencies } from "unstorage";
builtinDriverDependencies["azure-storage-blob"];
// {
// lib: { name: "@azure/storage-blob", version: "^12.31.0" },
// identityLib: { name: "@azure/identity", version: "^4.13.0", optional: true },
// }
optional: true means the package is only needed for some driver features or configurations — for example chokidar is only used by the fs driver's watch(). Drivers with no third-party dependencies are absent from the map.