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

vinyl.toJSON method? #83

Open
Marak opened this issue Apr 20, 2016 · 4 comments
Open

vinyl.toJSON method? #83

Marak opened this issue Apr 20, 2016 · 4 comments
Milestone

Comments

@Marak
Copy link

Marak commented Apr 20, 2016

Hello.

Was wondering if there is any support for turning a vinyl File into a JSON object? I couldn't seem to find anything.

Obviously I can write a simple serialization method, but I was wondering if it exists anywhere else in the tool-chain. If not, would you want to add File.toJSON to core?

Marak added a commit to Marak/vinyl that referenced this issue Apr 20, 2016
  * Serializes vinyl File object into JSON
  * First pass. Seems to be working
  * No tests
@phated
Copy link
Member

phated commented Apr 20, 2016

Good idea. I want to test this against a logging stream to make sure the custom display is used over toJSON

@phated phated modified the milestone: 2.x Sep 7, 2016
@phated phated added this to Nice to Have in v4 Mar 8, 2017
@yocontra
Copy link
Member

yocontra commented Aug 4, 2017

@Marak Still interested in this?

I'd like it to support this ideally: new File(otherFile.toJSON()) - might be overkill though to include history and other fields that might not be pretty to look at in a log.

Should we lose history here? Just stat/path/contents? LMK

@phated
Copy link
Member

phated commented Aug 4, 2017

@contra we can't actually do this due to streaming contents. It's the main reason I opened #133, which will be revisited in the next major (after gulp 4).

@yocontra yocontra modified the milestones: Future, 2.x Aug 4, 2017
@yocontra yocontra removed this from Nice to Have in v4 Aug 4, 2017
@Marak
Copy link
Author

Marak commented Aug 4, 2017

I can't remember the specifics, but it seemed to be having been working fine for my use-case.

I needed to serialize the object in order to inspect its properties, not inspect it's binary contents or stream data.

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

3 participants