Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
104 views

In Node.js, I noticed that file operations were not always stable. I have the impression that fs gives up when the operations are not completely finished. Here is an example to illustrate: "use ...
pronodingo's user avatar
1 vote
1 answer
1k views

I have log file named request.log this is the content of the log file [2022-06-30T09:56:40.146Z] ### POST https://test.csdf/auth/send_otp { "method": "POST", "...
N Hilmi's user avatar
  • 77
0 votes
0 answers
271 views

here i want to use fs library at the js file to create and edit a json file. but whenever i include this namespace an strange error comes up. if i use var fs = require("fs") it throws the ...
mohammadhosseinborhani's user avatar
0 votes
1 answer
267 views

I'm wondering how I'd be able to read file names from my directory and be able to display them in table form to a window. I already have an attempt I made below but for some reason whenever I run the ...
Ewgavin's user avatar
  • 13
-1 votes
2 answers
304 views

I have this code: (i need to use async because this function may be used multiple times per second, so file won't be saved without async) var fs = require('fs').promises; async function stater(amount){...
mkrdev's user avatar
  • 27
1 vote
1 answer
1k views

I was using fs to write values from textarea into a file and had issues with the path until I found on stackoverflow that the path has to be a tmp folder. I did that and the terminal shows the ...
Sugared Maple's user avatar
0 votes
2 answers
789 views

Within a javascript function, I'm taking in a list of events and for each event, I would like to write text to a file. I have provided the correct // Code within another function events.map(event =>...
ENV's user avatar
  • 1,342
0 votes
0 answers
24 views

I tried this method : var fs = require("fs"); //or try //var fs = require("file-system"); var cont = " selamm \n"; fs.writeFileSync("read2.txt", cont, { flag: 'a' }, err => { }); ...
tester_anonim's user avatar
-2 votes
2 answers
1k views

I think I should use fs but I am not pretty sure how ejs: <form action="/products" method="POST"> <input type="file" name="image" id="image"> <button class="submit">Submit<...
Baraa Baba's user avatar
2 votes
1 answer
6k views

I'm trying to make a discord bot that saves images sent to it into a folder, and I'm getting this error: TypeError: [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an ...
m_hm0ud's user avatar
  • 105
0 votes
1 answer
309 views

I have a big problem and I hope someone can help me. Some time ago I created a "Desktop App" with Electron, consequently, I was able to freely use the "file-system" library but now ...
AmoxiciTeo's user avatar
1 vote
1 answer
22 views

On my webpage user can enter text and press send. this causes the server to append the message to a json object stored in a file. when this file is altered it then sends the new json to the client. ...
Dominic Johnston Whiteley's user avatar
0 votes
0 answers
1k views

I have 2 paths: app/consultants/pages/assignments app/consultants/pages/consultants Both paths contain subdirectories and files. I created a reduce function that returns an array of objects with the ...
Dileet's user avatar
  • 2,064
0 votes
1 answer
241 views

If I have a program as follows to modify a JSON file: var fs = require('fs'); var dt = require('./dataWrite.json'); console.log("before",dt); fs.readFile('./data.json', 'utf8', (err, data) =&...
Vayun's user avatar
  • 91
0 votes
1 answer
314 views

I need to execute the equivalent of chattr +i myfile.txt in rust. Since the call for chmod is fs::set_permissions() I was expecting something like fs::set_attributes() to also exists, but I cannot ...
NerdEngine's user avatar
-1 votes
1 answer
111 views

I am using node's module fs. When I run the following code: return new Promise((resolve, reject) => { if (!fs.existsSync(`./${imageDescription}`)) { axios.get(imageUrl).then((...
Xavi Font's user avatar
  • 574
0 votes
1 answer
1k views

I have a nodeJS app server-side that receives files. The user sends a file from the client and I want to make several operations, one of them being moving the file to the final destination. I used to ...
djcaesar9114's user avatar
  • 2,147
1 vote
0 answers
275 views

I have a problem with stream.pipeline() await pipeline( req.file.buffer, fs.createWriteStream( `${__dirname}/../client/public/profil/${fileName}` ) ) I have this error TypeError [...
user10863293's user avatar
4 votes
1 answer
21k views

When I try to import the fs module in my own module like import * as fs from 'fs' the following error in the browser console comes: Uncaught TypeError: Failed to resolve module specifier "fs"...
piffels's user avatar
  • 43
0 votes
2 answers
182 views

So I wrote this fs function to read files data from a file: const fs = require("fs"); const read = function (file) { fs.readFile(file, "utf8", (err, data) => { if (err !==...
aNewmoon's user avatar
2 votes
1 answer
798 views

I made a code to write a file using fs and node-cron to run this every x minutes. I get the data the first time, but in the next job I get the data added again in the file and the old one too, I wan ...
Mariano Bordon's user avatar
0 votes
2 answers
798 views

I wrote a code which help me to read all the folder file and make me store them in array format so my code looks like this readAll.js module.exports = readAllFile = () => { const arr = []; fs....
Rahul Yadav's user avatar
1 vote
0 answers
382 views

I'm using Node.js to copy a few files for one of my packages. My OS is Windows 10 Pro. When I run the JS file (tried in cmd, powershell and cmd with admin) absolutely nothing happens. No error, no ...
ProGamer2711's user avatar
0 votes
0 answers
115 views

I have a string with hexadecimal code for an object file I have generated in a program previously in my JavaScript file. How can I create an object file with this code, preferably with the fs module? ...
IT with Lyam's user avatar
0 votes
0 answers
15 views

I'm using fs.readdir callback function to do stuff in a path file but i want to wait for the callback to be finished to continue on with the rest of my code. const get = async(path_files) => { ...
RouckyKM's user avatar
  • 147

1
5 6
7
8 9
64