Skip to content
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

Make vinyl files more web File like #156

Open
jimmywarting opened this issue Dec 7, 2022 · 3 comments
Open

Make vinyl files more web File like #156

jimmywarting opened this issue Dec 7, 2022 · 3 comments

Comments

@jimmywarting
Copy link

jimmywarting commented Dec 7, 2022

Describe your idea for a new feature

I propose making the virtual files more web- Blob/File IDL like by introducing: stream(), text(), arrayBuffer(), slice(), size, name and type

Explain the problem your idea is trying to solve

I think ppl would feel more at home if virtual files where more like web Blob/File (in fact they are introduced into NodeJS at this point globally)
if they behaved more like Blob/Files then it would also be possible to use them with eg fetch and FormData and you would even be able to concat files together using new Blob([ virualFileA, virualFileB ]) - that's if you are using fetch-blob

If this feature could exist outside of gulp (like as a plugin or a module), would you be interested in helping to create and maintain it?

Hmm, it could exist outside of gulp, but then i would have to add new prototype methods to vinyl files. or extend it...

@phated
Copy link
Member

phated commented Dec 7, 2022

This is a pretty good idea. I'll slate it to discuss with the team to see if we can reconcile the idea with the future plans for Vinyl.

@phated phated added this to post-v5 Dec 7, 2022
@jimmywarting
Copy link
Author

jimmywarting commented Dec 8, 2022

just by making vinyl files more like blobs would mean that lots of other packages that base it's code on Blob would actually start to work with vinyl files too.
There are lots of other packages like zip/pdf/excl readers that operates solo on blob IDL api's
so having this blob methods on vinyl files would be really good 👍

@jimmywarting jimmywarting changed the title Make virtual more web File like Make vinyl files more web File like Dec 8, 2022
@jimmywarting
Copy link
Author

jimmywarting commented Dec 8, 2022

web stream would be tuff doe... it would kind of have to be conditionally supported based on if ReadableStream is supported in the current env. wouldn't mind if .stream() throwed a error telling me that web ReadableStream isn't supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants