Socket
Socket
Sign inDemoInstall

walker

Package Overview
Dependencies
2
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc