Questions tagged [node.js-fs]

203 questions
0
votes
0 answers

JSON.stringify() arguments returns objects in a straight line with slashes // in between

JSON.stringify() arguments still returns objects in a straight line with slashes // in between. I added ```JSON.stringify(stringifiedData, null, 4) to my code to prettify my object. But I am still getting all my data in a straight line with slashes…
Tini
  • 169
  • 8
0
votes
1 answer

Node https server crashing: `undefined` path in fs.readFile()

I'm setting up an https server but as soon as I access the root / the service crashes (after retrieving the html file successfully). The error is generated as per the debugger in the fs.readFile function. I think it might be associated with the…
0
votes
0 answers

Webm duration broken

I am recording screen with mediaRecorder in 10 second chunks of video. Then, with node.js, we put those videos together in a single webm. The problem is that we can't see the duration of the video when we play it. We tried the package…
ezek
  • 1
0
votes
1 answer

remove .git file using node.js

How do I delete a file with node.js? folder structure -> .git MachineFolder(non emtey) READEME.md I try to delete this code: - fs.readdir(dir, (err, files) => { if (err) throw err; Logger.log(files) try { for (const file of…
JaNith RathNayaka
  • 101
  • 1
  • 2
  • 10
0
votes
0 answers

Trying to read the contents of a directory with fs-extra

I am trying to map the max value of a slider to the number of pictures in a directory. I am trying to do that using fs-extra but I am not sure what I am doing wrong. I am getting errors when trying to import the function. I cannot download it…
Wx_Trader
  • 77
  • 7
0
votes
1 answer

Substitute a Value in a Json file with value from another Json

I have two JSON files data.json and values.json. I want to read whatever the values of aws and bucket in values.json are, and use them in data.json. How can I achieve this with node js? I have written a function that reads the content of the…
Tini
  • 169
  • 8
0
votes
1 answer

How to read directories and subdirectories (having 15000 subdirectories) using directory-tree npm in node js

We are using directory-tree npm to read all the directories and sub directories(subdirectories having 15000 multiple subdirectories) Used Code: const dirTree = require("directory-tree"); const allDirectories = dirTree('./test'); //It is taking…
Reena
  • 1
  • 1
0
votes
2 answers

npm run build fails node:internal/fs/utils:348 Error: ENOENT: no such file or directory

Running npm run build command fails with the error as shown in the screenshot. As it may be seen from the following images, the file does exist. Here is the version info node v14.17.6 npm 9.1.3 Mac OS 12.5.1 (Monterey) vue/cli-service":…
rhythmo
  • 859
  • 2
  • 9
  • 21
0
votes
0 answers

what is more faster? getting file tree from memory dis vs getting file tree from disk in nginx try_files

nginx can use "try_files" directive. and linux has a memory directory and just mounted disk directory. I have to create and remove many files on directory, i don't know what is more better. it doesn't matter to load file data because of…
JaeIL Ryu
  • 159
  • 10
0
votes
1 answer

fs.readFileSync in a template literal not working

I'm trying to read a file with fs.readFileSync. When I put fs.readFileSync into a Template literal I get following Error: Error: ENOENT: no such file or directory, open './cookie.txt' at Object.openSync (node:fs:590:3) at Object.readFileSync…
Unknown
  • 83
  • 1
  • 9
0
votes
1 answer

Memory leak using node, fs and readline

I'm trying to pass a huge csv data to sql and at half transaction it fails by memory leak: the error is exactly 'JavaScript heap out of memory'. Can you see anything that smells bad? Thank you in advance. const readline = require('readline'); const…
0
votes
1 answer

0xc00d36c4 while saving file to wav format nodejs amazon polly text to speech

I am using Amazon polly for text to speech. Here is the code static async _ttsUsingPolly(text, gender, destPath, speed) { let params = { 'Text': 'Hi, my name is @anaptfox.', 'OutputFormat': 'pcm', 'VoiceId': 'Kimberly', …
Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
0
votes
0 answers

Module not found: Error: Can't resolve 'fs' in 'C:\path.......\src\components' & node_modules doesn't exist or is not a directory

I don't know why I'm getting this error. Module not found: Error: Can't resolve 'fs' in 'C:\path.......\src\components' & node_modules doesn't exist or is not a directory I've tried this code on node: const fs = require('fs') const dir =…
Martin Gonzalez
  • 77
  • 1
  • 1
  • 12
0
votes
1 answer

Electron page navigation: Loading content and attached javascript

I am trying to create a basic page navigation in electron. In the electron api demo import is used for that purpose(as far as I can understand it). Regarding the import I found the information that its deprecated and was removed from Chrome in…
Amaroks
  • 29
  • 8
0
votes
1 answer

Auto close of "fs.createWriteStream()" to avoid potential memory leak

To upload a file locally I'm using the following code: import {pipeline} from "stream"; import {promisify} from "util"; const asyncPipeline = promisify(pipeline); await asyncPipeline( fileData.fileStream, fs.createWriteStream( …
Mike
  • 14,010
  • 29
  • 101
  • 161
1 2 3
13
14