What is the current directory when the method in the fs module is called in a typical node.js / Express application? For example:
var fs = require('fs'); var data = fs.readFile("abc.jpg", "binary");
What is the default folder used to search for abc.jpg? Is it dependent on the contents of the script folder?
Is there a way to query the current directory?
My file structure:
ExpressApp1/ app.js routes/ members.js
In members.js, I have fs.createWriteStream("abc") , and the abc file was created in ExpressApp1/
Old geezer
source share