list-contents
Advanced tools
Comparing version 1.0.0 to 2.0.1
12
index.js
@@ -5,6 +5,12 @@ /* global Promise */ | ||
const args = require('typeof-arguments'); | ||
const cliColor = require('cli-color'); | ||
const error = cliColor.red; | ||
const warn = cliColor.bgYellow.black; | ||
module.exports = function(getPath,callback){ | ||
if(!args(arguments,['string','function'])) return; | ||
var msgError = new Error(`\x1b[31mCould not get the access to the contents of the given directory path.\x1b[0m`); | ||
args(arguments,['string','function'],(a,e,m)=>{ | ||
var err = new TypeError(warn('list-contents') + ': ' + error(m)); | ||
throw err; | ||
}); | ||
var msgError = new Error(warn('list-contents') + ': ' + error('Could not get the access to the contents of the given directory path.')); | ||
var dirs = []; | ||
@@ -14,3 +20,3 @@ var files = []; | ||
run(getPath) | ||
.then(()=>callback({error:false,files:files,dirs:dirs,path:getPath})) | ||
.then(()=>callback({error:null,files:files,dirs:dirs,path:getPath})) | ||
.catch((err)=>callback({error:err,files:files,dirs:dirs,path:getPath})); | ||
@@ -17,0 +23,0 @@ |
{ | ||
"name": "list-contents", | ||
"version": "1.0.0", | ||
"version": "2.0.1", | ||
"description": "Returns a list of paths to the subfolders and subfiles of the specified location.", | ||
@@ -21,5 +21,14 @@ "main": "index.js", | ||
"dependencies": { | ||
"fs-extra": "^4.0.0", | ||
"typeof-arguments": "^1.0.4" | ||
} | ||
"cli-color": "^1.2.0", | ||
"fs-extra": "^4.0.1", | ||
"typeof-arguments": "^2.1.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/devrafalko/list-contents.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/devrafalko/list-contents/issues" | ||
}, | ||
"homepage": "https://github.com/devrafalko/list-contents#readme" | ||
} |
@@ -21,3 +21,3 @@ # Description | ||
* `error` [Boolean|Error] | ||
`false` if the **`path`** is valid, otherwise [Error] object | ||
`null` if the **`path`** is valid, otherwise [Error] object | ||
* `dirs` [Array] | ||
@@ -24,0 +24,0 @@ The list of all subfolders' paths of the specified **`path`** argument |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
6250
66
0
1
1
3
+ Addedcli-color@^1.2.0
+ Addedansi-regex@2.1.1(transitive)
+ Addedcli-color@1.4.0(transitive)
+ Addedd@1.0.2(transitive)
+ Addedes5-ext@0.10.64(transitive)
+ Addedes6-iterator@2.0.3(transitive)
+ Addedes6-symbol@3.1.4(transitive)
+ Addedes6-weak-map@2.0.3(transitive)
+ Addedesniff@2.0.1(transitive)
+ Addedevent-emitter@0.3.5(transitive)
+ Addedext@1.7.0(transitive)
+ Addedis-promise@2.2.2(transitive)
+ Addedlru-queue@0.1.0(transitive)
+ Addedmemoizee@0.4.17(transitive)
+ Addednext-tick@1.1.0(transitive)
+ Addedtimers-ext@0.1.8(transitive)
+ Addedtype@2.7.3(transitive)
+ Addedtypeof-arguments@2.1.1(transitive)
- Removedtypeof-arguments@1.0.4(transitive)
Updatedfs-extra@^4.0.1
Updatedtypeof-arguments@^2.1.1