Questions tagged [createwritestream]

54 questions
8
votes
1 answer

Adding 'silent frames' to a Node.js stream when no data is received

I am creating a Discord.js bot using Node.js that records the audio of users in a voice channel. It joins a channel and starts listening to each user separately. It records to a .pcm file (so only the raw data). Now, this works, but the nature of…
JasperJ
  • 81
  • 2
2
votes
2 answers

File download between Google Cloud -> Node server -> React client without saving locally in the server

I'm developing a corporative CRUD application, and one of the features is storing the subscribed user profile picture to Google Cloud, and downloading it when it is needed to display it. The fact is, when I need to download it, the request comes…
2
votes
0 answers

writeStream write prepends unknown characters to markdown file

I'm trying to edit markdown files through a web interface. I can already read and parse the files in my editor successfully. Now I'm trying to update the original file as the user is typing. I'm using createWriteStream with r+ flag. The user inputs…
Pierre Burton
  • 1,954
  • 2
  • 13
  • 27
2
votes
1 answer

fs.createwritestream is not a function

I am Trying to develop a react app that help me to download files to my amazon cloud. For that i used This module download-file-with-progressbar Here is my code: var dl = require('download-file-with-progressbar'); …
Savad
  • 1,240
  • 3
  • 21
  • 50
1
vote
0 answers

Trying to generate a 20+ gb zip file with JSZip + File System Access API, always fails around 20 GB

I've been experimenting with the file system access API recently to try to allow downloads of large directories from my site, where a page will start a write stream, start fetching the files, consolidate them into a zip file using JSZip, and save…
1
vote
2 answers

fs.createWriteStream cut file to 1mib

I use NestJS and fastify for my api-server. For files uploading used @fastify/multipart. This is what the function for downloading a file looks like async uploadFile(path, file): Promise { const normalPath =…
Vladimir
  • 53
  • 1
  • 5
1
vote
1 answer

How to write data into file in node JS?

I have these excel file contains columns : No, itemCode, startAt, endAt I loop the data using createReadStream And I want to detect the invalid datetime from excel file and write the error into test.txt file Here's my current code const csv =…
Rzj EM
  • 63
  • 4
1
vote
1 answer

NodeJS streaming gzip to a file

I am trying to write gzip'd content to a file to make the file smaller. I seem to be missing a step - when I read back the file, the text is plain text (e.g. hello there), instead of gzip'd content (e.g. \u001f\ufffd\b\u0000\u0000\u0000...). I've…
Nick Grealy
  • 24,216
  • 9
  • 104
  • 119
1
vote
1 answer

ffmpeg app using node occasionally crashes as file doesn't appear to be read correctly

I have an simple Node application that allows me to pass an AWS S3 URL link to a file (in this case video files). It uses the FFMPEG library to read the video file and return data like codecs, duration, bitrate etc.. The script is called from PHP…
Zabs
  • 13,852
  • 45
  • 173
  • 297
1
vote
1 answer

ERROR: TypeError: Cannot read property '...' of undefined using .end() with fs.createwritestream()

ERROR I get the error: ERROR: TypeError: Cannot read property 'outstream_for_folders' of undefined I don't understand why I am getting this error. I added lots of error checking for 'undefined', but I still get the error, so I think it may have…
Dan G
  • 11
  • 3
1
vote
0 answers

file is not getting deleted after being created by createWriteStream

const createPolicyPackage = (filePath, bufferStream) => new Promise(resolve => { let wstream = fs.createWriteStream(filePath); wstream.write(bufferStream); resolve(bufferStream); }); let policypath = 'pdfappl/' + submissionId + '_' + date +…
Shubham Shaw
  • 841
  • 1
  • 11
  • 24
1
vote
1 answer

Resumable and Validation on createWriteStream Node.js

I've been using Google cloud storage api to upload some files. I've run into some errors of socket hang up when using the request for the upload. After searching a bit, I've came across Error: socket hang up code: 'ECONNRESET' on Google cloud…
PedroSG
  • 466
  • 2
  • 9
  • 38
1
vote
1 answer

nodejs createWriteStream in nested for

I need to generate a huge number of combinations of string values, a few billion of lines and write them all in one large file to disk without the process being blocked. At this moment it works until the file write buffer is filled, for little lists…
stefcud
  • 2,220
  • 4
  • 27
  • 37
1
vote
2 answers

"callback is not a function" error while finish writeStream

variable avatar is a file path, dont worry about it. function rm (){ fs.rm(avatar) } writeStream.on("finish", rm()) but it is shows this error: TypeError: callback is not a function at CB (internal/fs/rimraf.js:59:5) at…
bahoz99
  • 121
  • 1
  • 6
1
vote
0 answers

Handling Asynchronous stream: Read and Write multiple csv files after filtering dates in nodejs

So I have a bunch of csv files which have more data then I require, I want to filter the data out by only having keeping the rows with dates after year 2015. The Problem is that it works for a single file but when I enter multiple files it writes…
1
2 3 4