walker
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "walker", | ||
"description": "A simple directory tree walker.", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"homepage": "https://github.com/nshah/nodejs-walker", | ||
@@ -6,0 +6,0 @@ "author": "Naitik Shah <n@daaku.org>", |
@@ -8,40 +8,42 @@ walker | ||
Walker('/etc/') | ||
.filterDir(function(dir, stat) { | ||
if (dir === '/etc/pam.d') { | ||
console.warn('Skipping /etc/pam.d and children') | ||
return false | ||
} | ||
return true | ||
}) | ||
.on('entry', function(entry, stat) { | ||
console.log('Got entry: ' + entry) | ||
}) | ||
.on('dir', function(dir, stat) { | ||
console.log('Got directory: ' + dir) | ||
}) | ||
.on('file', function(file, stat) { | ||
console.log('Got file: ' + file) | ||
}) | ||
.on('symlink', function(symlink, stat) { | ||
console.log('Got symlink: ' + symlink) | ||
}) | ||
.on('blockDevice', function(blockDevice, stat) { | ||
console.log('Got blockDevice: ' + blockDevice) | ||
}) | ||
.on('fifo', function(fifo, stat) { | ||
console.log('Got fifo: ' + fifo) | ||
}) | ||
.on('socket', function(socket, stat) { | ||
console.log('Got socket: ' + socket) | ||
}) | ||
.on('characterDevice', function(characterDevice, stat) { | ||
console.log('Got characterDevice: ' + characterDevice) | ||
}) | ||
.on('error', function(er, entry, stat) { | ||
console.log('Got error ' + er + ' on entry ' + entry) | ||
}) | ||
.on('end', function() { | ||
console.log('All files traversed.') | ||
}) | ||
```javascript | ||
Walker('/etc/') | ||
.filterDir(function(dir, stat) { | ||
if (dir === '/etc/pam.d') { | ||
console.warn('Skipping /etc/pam.d and children') | ||
return false | ||
} | ||
return true | ||
}) | ||
.on('entry', function(entry, stat) { | ||
console.log('Got entry: ' + entry) | ||
}) | ||
.on('dir', function(dir, stat) { | ||
console.log('Got directory: ' + dir) | ||
}) | ||
.on('file', function(file, stat) { | ||
console.log('Got file: ' + file) | ||
}) | ||
.on('symlink', function(symlink, stat) { | ||
console.log('Got symlink: ' + symlink) | ||
}) | ||
.on('blockDevice', function(blockDevice, stat) { | ||
console.log('Got blockDevice: ' + blockDevice) | ||
}) | ||
.on('fifo', function(fifo, stat) { | ||
console.log('Got fifo: ' + fifo) | ||
}) | ||
.on('socket', function(socket, stat) { | ||
console.log('Got socket: ' + socket) | ||
}) | ||
.on('characterDevice', function(characterDevice, stat) { | ||
console.log('Got characterDevice: ' + characterDevice) | ||
}) | ||
.on('error', function(er, entry, stat) { | ||
console.log('Got error ' + er + ' on entry ' + entry) | ||
}) | ||
.on('end', function() { | ||
console.log('All files traversed.') | ||
}) | ||
``` | ||
@@ -48,0 +50,0 @@ You specify a root directory to walk and optionally specify a function to prune |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
53
1
5089
3
102