Questions tagged [fs-extra]
57 questions
0
votes
0 answers
How to iterate over files with Promises in Node.js
I have a folder with a bunch of JSON files that looks like this:
|
|-foo.json
|-bar.json
|-qux.json
|-baz.json
|-zot.json
Each JSON file has a property children that points to some of the other JSON files, so that they all describe a tree. Now, say…
![](../../users/profiles/4124574.webp)
Mig82
- 3,665
- 1
- 30
- 55
0
votes
2 answers
Do not see the reason I am getting a NOENT returned when I can see the file at the exact spot I am calling for it to be
I know this is very similar to other questions that have been asked on the same error. In the case I have seen though, the file name had been left off of the url. In my case (as far as I know) the url is specified as it should be and I can see the…
![](../../users/profiles/5920923.webp)
doug5solas
- 77
- 9
0
votes
1 answer
Mongo/Mongoose/Multer/FS to delete an image
In the code given below:-
var Image = mongoose.model("Image", imageSchema); //Assuming all the configuration of packages are done
app.delete("/element/:id", function(req, res) {
Image.findByIdAndRemove(req.params.id, function(err) {
…
![](../../users/profiles/10543937.webp)
Aditya Shankar
- 1
- 1
0
votes
1 answer
node express: Issue with res.render() after writing file to disk
I'm writing a method that uses async/await and promises to write some JSON to a file and then render a pug template. But for some reason the code that writes the JSON conflicts with the res.render() method resulting in the browser not being able to…
![](../../users/profiles/963840.webp)
Malibur
- 1,455
- 5
- 19
- 26
0
votes
0 answers
NodeJs application stopping abrubtly while async file copy
I am trying to write a file copy code in Node.js:
function archiveFolder(site, callback) {
//console.log("Processing Site2 " + site );
var path = srcDir + '/' + site;
var startDate = moment(new Date(),…
![](../../users/profiles/1422000.webp)
Sravan
- 516
- 1
- 7
- 18
0
votes
0 answers
nodejs - fs_extra.copy - writing file to network drive -- creates file but 0 bytes
I am trying to write a file to a network drive with nodejs.
I have a network drive mounted. I can read it and write to the network drive from shell.
I am using this to copy a file:
fs_extra.copy('tempFileLocation', 'networkDrive' +…
![](../../users/profiles/5314097.webp)
philipfwilson
- 701
- 1
- 7
- 20
0
votes
1 answer
node js fs-extra outputFile data parameter as variable?
I delcare a function to create a file with path, and data as variable. here my code
const fse = require("fs-extra");
function createFile(name, contents) {
fse.outputFile(name, contents, function(err) {
}
};
than
var name =…
![](../../users/profiles/2148971.webp)
Ngô Hữu Nam
- 163
- 2
- 10
0
votes
1 answer
Copying file using node.js with the possibility of cancellation
I am implementing a node.js application which copies an array of file paths, into an specific destination.
The method is simple, Let's say I have 10 file paths at the Origin paths, and 1 path as the destination path. so Each From path will be copied…
![](../../users/profiles/1923733.webp)
Benjamin
- 2,434
- 2
- 28
- 54
0
votes
2 answers
Using fs.extra copyRecursive gives a "TypeError: forEachAsync is not a function" error and I can't fix it
My code is :
http://pastebin.com/rCy4wSUK
As soon as this function is called by router it prints
"done copying contents of clean base into temp" and then error which is here:
http://pastebin.com/UxEu4PaS
So at least it is not giving an error in…
![](../../users/profiles/5764507.webp)
Udarr
- 13
- 5
-1
votes
2 answers
Failling when installing fs-extra - react-native
~I'm creating a new app for android and when I command react-native run-android and this error comes up:
error: bundling failed: Error: Unable to resolve module fs from…
![](../../users/profiles/11923109.webp)
Luis Fernando
- 1
- 1
-1
votes
1 answer
fs-extra: Copy files without overwrite
I am using copy method of fs-extra to copy files from a source to destination. My use case is to create a copy of the file with a name like if a file of the same name exists in the destination. The copy method of fs-extra module overwrites the…
![](../../users/profiles/6697475.webp)
Ravi Kukreja
- 587
- 1
- 6
- 17
-1
votes
1 answer
Execute after FOR loop with FS action
I have a for loop that calls an action fs.copy after. After that for loop is complete I need to execute a command. I think I need to do a callback once the for is complete. The issue that I think I'm running into is the fs.copy is run async so the…
![](../../users/profiles/570624.webp)
Jason Small
- 1,014
- 1
- 12
- 28