Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

list-contents

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

list-contents - npm Package Compare versions

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc