Filesystem
Simplest and most basic storage that saves files to the filesystem.
Installation
- npm
- Yarn
- pnpm
npm install @farbor/storage-filesystem
yarn add @farbor/storage-filesystem
pnpm add @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
.