3,196 questions
0
votes
1
answer
50
views
Does fs.watch in Node.js listen to changes in hidden folders like .git?
If I watch a directory that has a .git inside of it and run fs.watch, does that listen to changes within .git folder?
For example if I use:
fs.watch(dir, { recursive: true }
-5
votes
1
answer
119
views
Why is arr undefined even though function returns an array? [duplicate]
const randomGIFFunc = async function(dirname) {
const dirPath = 'src/gifs/' + dirname;
fs.readdir(dirPath, (err, files) => {
if (err) {
console.log('Error reading directory: ', err );
...
0
votes
0
answers
42
views
How to mount a subdirectory(inode ) to a specific path? Kernel development
I'm working on a directory-level snapshot feature based on a file system, where a snapshot of a directory is recorded by an inode, and I want to implement how the snapshot sharing mount should be ...
1
vote
0
answers
33
views
Nodejs birthtime.getTime() of fs module works locally but not in production [duplicate]
I am trying to the select the most recently created file from an array of files. This works just fine on my local node environment on mac, however when I push to my production server instead of ...
0
votes
0
answers
87
views
pm2 windows service cannot access network drive in nodejs
I’m facing an issue with a Node.js application that uses the fs module to read files from a network drive on Windows. The app works fine during development, but when I run it as a PM2 service, it ...
4
votes
1
answer
328
views
Error packaging electron app that uses local files
I created an App using electron that interacts with local files using IPC. When i run it using npm start, éverything works as excpected, but when i try to package the app into an .exe file using the ...
0
votes
1
answer
78
views
Is there a way to open, save and close an excel file (.xlsx)?
I've got a daily automated function in nodejs which builds and populates an excel spreadsheet via the package xlsx-populate, which has been running for a couple of years now with no problems.
A ...
1
vote
1
answer
46
views
How do I send big files in nodejs from the client to the server without an "Uncaught out of memory" error?
When sending a big file, such as one over twenty megabytes from the client to the server using a fetch request, the HTML page with the file input freezes for about 10 seconds and gives the error in ...
0
votes
0
answers
41
views
Reset all the settings of an Electron-based app
My Electron app has a menu to Reset All of its settings. I do this by calling fs.rmSync(app.getPath('userData'), { recursive: true }) and it's working fine when it comes to, for instance, the position ...
0
votes
1
answer
65
views
fs.watch doesn't return an FSWatcher instance in Electron
I have an Electron React App
Where I'm trying to call .close() on the object that I assigned an fs.watch to. But I think Vite, Electron or something is wrapping something around the object returned ...
2
votes
1
answer
338
views
How to get rid of warning "lint TP1004 fs.existsSync(???*0*) is very dynamic" in nextjs 14.2.5 server
Using nextjs 14.2.5, in one of the server component, I need to save a temp file to server storage, the code works fine, but every time the server component is called, there's the this warning
lint ...
0
votes
1
answer
44
views
Why don't folders delete in gulp tasks? [duplicate]
This task work ok. I use path ".wwwroot/css/site.min.css"
var gulp = require("gulp");
const fs = require('fs').promises;
gulp.task('clean', async function (done) {
try {
...
0
votes
0
answers
54
views
Is there a standard way for unique file content per user in Javascript
I am running a server in which users get a javascript file when they sign up. They can use this on their website, and I can track it.
So people register through my expressjs project, but to change the ...
1
vote
1
answer
275
views
Read from nth row in csv typescript
I am trying to read a csv file from 4th row, in my csv file first 3 rows contains some meta data in column1. But the actual number of columns in csv is 6.
eg:
metadata1
metadata2
metadata3
head01,...
1
vote
0
answers
179
views
Loading file list in Next.js does not reflect the latest changes
In Next.js, I implemented a feature to fetch a list of files in a specific directory using a module like fs.
When I deployed it, the functionality itself worked fine, but when I took actions such as ...
0
votes
0
answers
46
views
Cannot read a double nested directory
Essentially I'm trying to store all of file system in a certain dir in an array of objects. Here is my code:
type Cache = {
path: string;
content: Buffer;
};
const readdir = (dir: string, ...
0
votes
0
answers
67
views
How to read a file from url with Node.js and Electron
How can I read a file with nodejs, even json, from url?
My file is on a server. I tried with ftp download but it is very inefficient.
Now is working on this, but is very slow for download and running.....
0
votes
0
answers
60
views
Login page HTTP request sends infinitely
A few hours ago i made a similar question but i was addressing the wrong issues.
the real problem is, i have this functional login function:
async function entrar() {
const user_name = ...
-1
votes
1
answer
35
views
nodejs rewrite file segment
In nodejs, how do I overwrite a section of a file without creating additional files or reading all the data into memory?
let filename= '123.txt';
const fd = fs.openSync(filename, 'w+');
fs.writeSync(...
0
votes
1
answer
64
views
How to wait till all compressed files are extracted
For the below posted code in section code-1, I extract the contents of .tar file to a specific path. Then I want to rename the the extracted files as shown in the code.
The number of extracted files ...
0
votes
0
answers
84
views
How to extract and write contents of tar file to disk
I make RESTAPI call to an endpoint, and I receive the response in the following format
<Buffer 4d 4d 00 2a 00 00 00 08 00 13 01 00 00 03 00 00 00 01 01......
what i am receiving is tar file ...
0
votes
1
answer
117
views
Node fs file does not exist
I have the following code to read a file in my project with Node fs.
const files: FileSystemTree = {
"Component.tsx": {
file: {
contents: fs.readFileSync(
...
0
votes
1
answer
46
views
Difference between two blocks of code involving fs.writeFile() in Node.js
I am trying to declare a POST method for a RESTful API using node and express. I need to accept the request body and write it onto a JSON file that I'm using to store my users data. I am using the fs ...
0
votes
0
answers
145
views
Why NodeJS fs module won't read or write to visible folder shared on the network?
I'm scaling my NodeJS app (on Windows 11) and need to setup additional workstations (Windows 11 aswell).
Right now I simply need a shared folder, so I created one and made it visible on the network. ...
0
votes
0
answers
20
views
fs.readdir give no results and no errors
Here is my function (which should rename the newest file of a given directory, if the file has a type of extension) :
const fs = require('fs').promises; // Note the .promises
function renameLatestFile(...