- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrw.js
More file actions
Latest commit
21 lines (18 loc) · 414 Bytes
/
Copy pathrw.js
File metadata and controls
21 lines (18 loc) · 414 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
constfs=require('fs');
functiongetFileContent(srcPath,callback){
fs.readFile(srcPath,'utf8',function(err,data){
if(err)throwerr;
callback(data);
}
);
}
functionsaveFile(savPath,data){
fs.writeFile(savPath,data,function(err){
if(err)throwerr;
console.log('complete');
});
}
module.exports={
getFileContent,
saveFile
}