Processing a json, keeping some attributes as string and others as a stream #151
Unanswered
mbenedettini
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to parse a json with the following format:
where as output I'd like to retain the content as a stream since it can be very long, so the output structure should be something like so that afterwards I can pipe them into an S3 upload (@aws-sdk/lib-storage):
Getting the attributes that are not "files" is easy and I omitted that from the following code, where I'm trying to get the filename as a string on one pipeline and the contents as a stream on the other one. The problem is how to connect them both?
I am thinking of doing something with two promises so that one promise is the filename and the other one is the contents stream and once both are fulfilled I would know that one file has been parsed but I'm not sure that's the best way since I will need a pair of promises for each files entry.
Is there an alternative? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions