-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What should the syntax be like? #3
Comments
Funny, just thought: "we already have FileReader, why not FileWriter?" var writer = new FileWriter('filename')
writer.readAsBlob(blob)
writer.readAsSocket(new WebSocket)
writer.readAsStream(audioStream) Maybe cuz it's a bad idéa and we have to support all of them. How about: var writer = new FileWriter(stream, 'filename')
// writer.methods? writer.close() still think you should close it using the streams close method instead... let writeStream = createWriteStream("filename")
stream.pipeTo( writeStream )
writeStream.close()
// stream is still alive |
One thing that i have experience when using this for a little while now with this syntax saveStream(stream, "filename") Is that: if you want to close the stream-saver you would need to close the stream you are trying to save... I'm leaning more towards creating a |
@eligrey and everyone else do you have some spare time to look at the difference? I have experience with both saveStream(stream, "filename") And also this: (checkout the Writable branch) var myFile = fs.createWriteStream("filename")
myFile.write("abc")
// you could also do this:
let stream = fs.createBlobReader(blob)
stream.pipeTo(myFile) What do you think is best? |
I know now what i want... |
I would want the syntax to be dead simple like FileSaver.js where you just type
One problem I see with
.pipeTo()
is that it's not widely adopted yet.Maybe we want save more than just streams that are not streams but could as well act like a stream? What could that be? what can we save?
Surely we can't adopt everything into the same function that dose all magic depending on what type it's
but we can help turn each of them into a stream that can then be used by each other
The text was updated successfully, but these errors were encountered: