diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-11 13:31:19 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-11 13:31:19 +0100 |
commit | 87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17 (patch) | |
tree | 130a210e1095daafd0d9368a959c729ffe7c3839 /lib/fs | |
parent | 02cff8c72ca742cd06a65d171657eb230eedbc5b (diff) | |
download | gitbook-87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17.zip gitbook-87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17.tar.gz gitbook-87d90a65ac6d1ceb5c1ce255d71713cff7dc9d17.tar.bz2 |
Stat file when parsing page
Diffstat (limited to 'lib/fs')
-rw-r--r-- | lib/fs/index.js | 5 | ||||
-rw-r--r-- | lib/fs/node.js | 5 |
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); |