What is the current directory when a method in the fs
module is invoked in a typical node.js/Express app? For example:
var fs = require('fs');
var data = fs.readFile("abc.jpg", "binary");
What is the default folder used to locate abc.jpg? Is it dependent on the containing script's folder location?
Is there a method to query the current directory?
My file structure is:
ExpressApp1/
app.js
routes/
members.js
In members.js I have a fs.createWriteStream("abc")
and file abc
was created in ExpressApp1/