Skip to main content

Filesystem

Simplest and most basic storage that saves files to the filesystem.

Installation

npm install @farbor/storage-filesystem

Usage

import { AssetStorage, ProcessedAssetStorage } from '@farbor/storage-filesystem'

const config = {
collectionsDefaults: {
// creates a storage and ensures provided root directory exists
storage: AssetStorage.fromUncheckedRootDirectory('/path/to/storage'),
processedStorage: ProcessedAssetStorage.fromUncheckedRootDirectory('/path/to/processed-storage')
}
}

Asset visibility

Asset visibility is stored within chmod for a file. Once file has permission to be read by others then asset visibility is public - otherwise private.