FileSystemStorageBackend
Implements
Index
Constructors
constructor
Parameters
options: FileSystemStorageOptions
Returns FileSystemStorageBackend
Properties
readonlydatasetsDirectory
readonlykeyValueStoresDirectory
readonlylocalDataDirectory
optionalreadonlylogger
readonlyrequestQueueAccess
readonlyrequestQueuesDirectory
Methods
createDatasetBackend
Create (or open) a dataset backend. If
idis provided, opens the dataset with that ID. Ifnameis provided, opens an existing dataset with that name or creates a new one. If neither is provided, opens or creates the default dataset.Parameters
options: StorageIdentifier = {}
Returns Promise<DatasetBackend<Dictionary>>
createKeyValueStoreBackend
Create (or open) a key-value store backend. If
idis provided, opens the key-value store with that ID. Ifnameis provided, opens an existing store with that name or creates a new one. If neither is provided, opens or creates the default key-value store.Parameters
options: StorageIdentifier = {}
Returns Promise<KeyValueStoreBackend>
createRequestQueueBackend
Create (or open) a request queue backend. If
idis provided, opens the request queue with that ID. Ifnameis provided, opens an existing queue with that name or creates a new one. If neither is provided, opens or creates the default request queue.Parameters
options: StorageIdentifier = {}
Returns Promise<RequestQueueBackend>
getStorageBackendCacheKey
Return a cache key that includes the resolved storage directory, so that two
FileSystemStorageBackendinstances pointing at different directories get separate cache partitions, by including the storage directory in the cache key.Returns string
purge
Cleans up the run-scoped storages before the run starts, sweeping the storage directories so that leftovers from a previous process are caught too.
Returns Promise<void>
storageExists
Check whether a storage with the given ID exists.
Used internally to resolve ambiguous
idOrNamestrings passed toDataset.open(),KeyValueStore.open(), andRequestQueue.open().Parameters
id: string
type: Dataset | KeyValueStore | RequestQueue
Returns Promise<boolean>
teardown
This method should be called at the end of the process, to ensure all data is saved.
It persists the state of every opened request queue so that requests fetched but not yet handled are not stuck (until their lock expires) for the next consumer of the same on-disk queue.
Returns Promise<void>
A file-system storage backend backed by the native
@crawlee/fs-storage-nativeRust extension.The native extension owns the on-disk format, timestamps, item counting, request-queue locking and state persistence. This class is responsible for resolving the user-facing
id/name/aliasidentifiers to native storages, caching the opened backends (so thatstorageExists,purgeandteardowncan operate over them), and exposing them through the@crawlee/typesinterfaces.