tweedegolf / storage-abstraction

Provides an abstraction layer for interacting with a storage; the storage can be local or in the cloud.
MIT License
110 stars 18 forks source link

Local Adapter File Writes Require bucketName #64

Closed granthusbands closed 7 months ago

granthusbands commented 8 months ago

I just had trouble writing files to local storage because bucketName is required (either on the writeFile or on the config object). Can it just not? I want to just write files into the given folder, not into a subfolder.

abudaan commented 7 months ago

Yes, that is done because of consistency; all cloud storage services require a bucket name.

If you want to store files directly in a local folder you can do this:

  // config url
  const config = "local://./@folder";

  // config object
  const config = {
    type: StorageType.LOCAL,
    directory: "./",
    bucketName: "folder",
  };