@ionic/utils-fs
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -6,2 +6,14 @@ # Change Log | ||
<a name="1.2.0"></a> | ||
# [1.2.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-fs@1.1.1...@ionic/utils-fs@1.2.0) (2019-03-06) | ||
### Features | ||
* **fs:** add `isExecutableFile` utility ([53d9626](https://github.com/ionic-team/ionic-cli/commit/53d9626)) | ||
* **fs:** add `pathReadable`, `pathWritable`, and `pathExecutable` ([5412791](https://github.com/ionic-team/ionic-cli/commit/5412791)) | ||
<a name="1.1.1"></a> | ||
@@ -8,0 +20,0 @@ ## [1.1.1](https://github.com/ionic-team/ionic-cli/compare/@ionic/utils-fs@1.1.0...@ionic/utils-fs@1.1.1) (2019-02-27) |
@@ -93,2 +93,6 @@ /// <reference types="node" /> | ||
export declare function pathExists(filePath: string): Promise<boolean>; | ||
export declare function pathReadable(filePath: string): Promise<boolean>; | ||
export declare function pathWritable(filePath: string): Promise<boolean>; | ||
export declare function pathExecutable(filePath: string): Promise<boolean>; | ||
export declare function isExecutableFile(filePath: string): Promise<boolean>; | ||
/** | ||
@@ -95,0 +99,0 @@ * Find the base directory based on the path given and a marker file to look for. |
@@ -185,2 +185,27 @@ "use strict"; | ||
exports.pathExists = pathExists; | ||
function pathReadable(filePath) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return pathAccessible(filePath, fs.constants.R_OK); | ||
}); | ||
} | ||
exports.pathReadable = pathReadable; | ||
function pathWritable(filePath) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return pathAccessible(filePath, fs.constants.W_OK); | ||
}); | ||
} | ||
exports.pathWritable = pathWritable; | ||
function pathExecutable(filePath) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return pathAccessible(filePath, fs.constants.X_OK); | ||
}); | ||
} | ||
exports.pathExecutable = pathExecutable; | ||
function isExecutableFile(filePath) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const [stats, executable] = yield Promise.all([safe.stat(filePath), pathExecutable(filePath)]); | ||
return !!stats && (stats.isFile() || stats.isSymbolicLink()) && executable; | ||
}); | ||
} | ||
exports.isExecutableFile = isExecutableFile; | ||
/** | ||
@@ -187,0 +212,0 @@ * Find the base directory based on the path given and a marker file to look for. |
{ | ||
"name": "@ionic/utils-fs", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Filesystem utils for Node", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
23225
482