Comparing version 0.6.1 to 0.6.2
@@ -230,3 +230,45 @@ /* | ||
// See also github: kevva/executable (by Kevin Mårtensson) | ||
// A small utility function return true if the path exists AND is a directory | ||
fsKit.isDir = fsKit.isDirectory = async ( path_ ) => { | ||
try { | ||
var stats = await fs.promises.stat( path_ ) ; | ||
} | ||
catch ( error ) { | ||
return false ; | ||
} | ||
return stats.isDirectory() ; | ||
} ; | ||
// A small utility function return true if the path exists AND is a file (not a directory) | ||
fsKit.isFile = async ( path_ ) => { | ||
try { | ||
var stats = await fs.promises.stat( path_ ) ; | ||
} | ||
catch ( error ) { | ||
return false ; | ||
} | ||
return stats.isFile() ; | ||
} ; | ||
// A small utility function return true if the path exists AND is a file (not a directory) AND has exe permission (LINUX ONLY) | ||
fsKit.isExe = async ( path_ ) => { | ||
try { | ||
var stats = await fs.promises.stat( path_ ) ; | ||
} | ||
catch ( error ) { | ||
return false ; | ||
} | ||
return stats.isFile() && fsKit.statsHasExe( stats ) ; | ||
} ; | ||
// See also github: kevva/executable (by Kevin Mårtensson) (LINUX ONLY ATM) | ||
fsKit.statsHasExe = stats => { | ||
@@ -233,0 +275,0 @@ if ( process.platform === 'win32' ) { return true ; } |
{ | ||
"name": "fs-kit", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "A Filesystem toolbox.", | ||
@@ -5,0 +5,0 @@ "main": "lib/fs.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
22034
476