Comparing version 0.3.1 to 0.4.0
# Release notes for `m-io` | ||
<a name="current-release"></a> | ||
# Version 0.4.0 (Mon, 13 Feb 2017 22:59:01 GMT) | ||
* [932d674](https://github.com/nknapp/m-io/commit/932d674) Add function `.isDirectory()` - Nils Knappmeier | ||
* [4b12e8f](https://github.com/nknapp/m-io/commit/4b12e8f) Remove Node 0.10 and 5 from TravisCI and add 7 - Nils Knappmeier | ||
# Version 0.3.1 (Tue, 20 Dec 2016 00:01:59 GMT) | ||
@@ -5,0 +10,0 @@ |
15
fs.js
@@ -61,3 +61,3 @@ /*! | ||
makeTree: function makeTree (aPath, mode) { | ||
return Q.nfcall(require('mkdirp'), aPath, {mode: mode}) | ||
return Q.nfcall(require('mkdirp'), aPath, { mode: mode }) | ||
}, | ||
@@ -97,4 +97,15 @@ | ||
return Q.ninvoke(fs, 'stat', aPath) | ||
}, | ||
isDirectory: function isDirectory (directory) { | ||
return this.stat(directory) | ||
.then( | ||
function (stat) { | ||
return stat.isDirectory() | ||
}, | ||
function () { | ||
return false | ||
} | ||
) | ||
} | ||
} | ||
@@ -101,0 +112,0 @@ |
{ | ||
"name": "m-io", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "(Incomplete) replacement for q-io", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -58,2 +58,12 @@ # m-io | ||
// Checking for directories | ||
.then(() => FS.isDirectory('city/germany')) | ||
.then((isDirectory) => console.log('Is `city/germany` a directory?', isDirectory)) | ||
.then(() => FS.isDirectory('city/germany/darmstadt.md')) | ||
.then((isDirectory) => console.log('Is `city/germany/darmstadt.md` a directory?', isDirectory)) | ||
.then(() => FS.isDirectory('city/germany/non-existing-file')) | ||
.then((isDirectory) => console.log('Is `city/germany/non-existing-file` a directory?', isDirectory)) | ||
// Directory listings | ||
@@ -85,2 +95,5 @@ .then(() => FS.list('city')) | ||
Directory something-else exists? false | ||
Is `city/germany` a directory? true | ||
Is `city/germany/darmstadt.md` a directory? false | ||
Is `city/germany/non-existing-file` a directory? false | ||
Directory entries of city [ 'france', 'germany', 'usa' ] | ||
@@ -87,0 +100,0 @@ List files: [ 'city/france/paris.md', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17724
168
214