AlexanderYW / Adonis-Drive-Azure-Storage

💾 Azure Storage driver for Adonis Drive
MIT License
11 stars 2 forks source link

Option to create a writable stream for the blob #22

Open baybal opened 4 years ago

baybal commented 4 years ago

Is your feature request related to a problem? Please describe. I need an option to create a writable stream for the blob

Describe the solution you'd like Instead off

await Drive.disk('azure').putStream('unicorn.jpg', stream)

I want to be able to do

const unicornStream = await Drive.disk('azure').getWriteableStream('unicorn.jpg')

someStream1.pipe(unicornStream)
someStream2.pipe(unicornStream)
someStream3.pipe(unicornStream)

Or even

const unicornReadStream = await Drive.disk('azure').getStream('unicorn.txt')
const unicornWriteStream = await Drive.disk('azure').getWriteableStream('unicorn.txt.xz.aes')

await pipeline(
  unicornReadStream,
  xz.createXZ(),
  crypto.createCipheriv(algorithm, key, iv),
  unicornWriteStream
);
AlexanderYW commented 4 years ago

Hi @baybal, thanks for your feature idea, seems like a good case that needs support, if you like your more than welcome to implement it if you need it now :)