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

diread

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diread - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

17

index.js

@@ -28,2 +28,3 @@ 'use strict';

* @param {Function} [options.mask]
* @param {Boolean} [options.ignoreError=true]
*/

@@ -37,2 +38,5 @@ Diread.prototype.initialize = function(options) {

function() { return true; };
this._ignore_error = options.ignoreError === void 0?
true :
options.ignoreError;

@@ -42,5 +46,8 @@ this._current_read_level = 0;

try {
if(this._ignore_error) {
try {
this._read_by_path(this._directory_path, '');
} catch(err) {}
} else {
this._read_by_path(this._directory_path, '');
} catch(err) {
}

@@ -88,3 +95,3 @@ };

if(is_directory) {
if(this._check_directories) {
if(this._check_directories && path !== this._directory_path) {
if(!this._mask(path)) {

@@ -94,5 +101,3 @@ return;

if(path !== this._directory_path) {
this._list_of_file_path.push(path);
}
this._list_of_file_path.push(path);
}

@@ -99,0 +104,0 @@

{
"name": "diread",
"version": "0.1.0",
"version": "0.2.0",
"description": "Module for reading all files in directory",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -63,2 +63,16 @@ 'use strict';

});
it('should not check self directory', function() {
var initial_folder = Path.resolve(process.cwd(), 'test/folder');
Diread({
src: initial_folder,
directories: true,
ignoreError: false,
mask: function(path) {
assert.notEqual(initial_folder, path);
return true;
}
});
});
});
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