Open zhoocoo opened 4 years ago
I have tested these code locally, and it works well, there are some points:
Add a { path: 'no-this-file.txt' }
option, and then isFileStream(streamFile)
will be true
.
Dig into ERR_UNHANDLED_ERROR
, and investigate specified error reason.
const streamFile = string2fileStream(new Buffer('12344').toString(), { path: 'no-this-file.txt' })
console.log(isFileStream(streamFile));
console.log(new Buffer('12344').toString());
// output
true
12344
Hope this will be helpful for you.
I get errors like this below:
and my code like this:
the
chunk
is belone tothrough2.obj(function(chunk, encoding, cb)
please help me to reslove this problem, I can't transform the string to a filestream.