summaryrefslogtreecommitdiffstats
path: root/lib/fs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fs')
-rw-r--r--lib/fs/index.js5
-rw-r--r--lib/fs/node.js5
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/fs/index.js b/lib/fs/index.js
index 7b8fc46..bcd9345 100644
--- a/lib/fs/index.js
+++ b/lib/fs/index.js
@@ -30,6 +30,11 @@ FS.prototype.read = function(filename) {
// To implement for each fs
};
+// Read stat infos about a file
+FS.prototype.stat = function(filename) {
+ // To implement for each fs
+};
+
// Write a file and returns a promise
FS.prototype.write = function(filename, buffer) {
// To implement for each fs
diff --git a/lib/fs/node.js b/lib/fs/node.js
index 5994c2e..f9a885d 100644
--- a/lib/fs/node.js
+++ b/lib/fs/node.js
@@ -28,6 +28,11 @@ NodeFS.prototype.read = function(filename) {
return Promise.nfcall(fs.readFile, filename);
};
+// Read stat infos about a file
+NodeFS.prototype.stat = function(filename) {
+ return Promise.nfcall(fs.stat, filename);
+};
+
// Write a file and returns a promise
NodeFS.prototype.write = function(filename, buffer) {
var folder = path.dirname(filename);