Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. walker [![Build Status](https://secure.travis-ci.org/daaku/nodejs-walker.png)](http://travis-ci.org/daaku/nodejs-walker)
  2. ======
  3. A nodejs directory walker. Broadcasts events for various file types as well as
  4. a generic "entry" event for all types and provides the ability to prune
  5. directory trees. This shows the entire API; everything is optional:
  6. ```javascript
  7. Walker('/etc/')
  8. .filterDir(function(dir, stat) {
  9. if (dir === '/etc/pam.d') {
  10. console.warn('Skipping /etc/pam.d and children')
  11. return false
  12. }
  13. return true
  14. })
  15. .on('entry', function(entry, stat) {
  16. console.log('Got entry: ' + entry)
  17. })
  18. .on('dir', function(dir, stat) {
  19. console.log('Got directory: ' + dir)
  20. })
  21. .on('file', function(file, stat) {
  22. console.log('Got file: ' + file)
  23. })
  24. .on('symlink', function(symlink, stat) {
  25. console.log('Got symlink: ' + symlink)
  26. })
  27. .on('blockDevice', function(blockDevice, stat) {
  28. console.log('Got blockDevice: ' + blockDevice)
  29. })
  30. .on('fifo', function(fifo, stat) {
  31. console.log('Got fifo: ' + fifo)
  32. })
  33. .on('socket', function(socket, stat) {
  34. console.log('Got socket: ' + socket)
  35. })
  36. .on('characterDevice', function(characterDevice, stat) {
  37. console.log('Got characterDevice: ' + characterDevice)
  38. })
  39. .on('error', function(er, entry, stat) {
  40. console.log('Got error ' + er + ' on entry ' + entry)
  41. })
  42. .on('end', function() {
  43. console.log('All files traversed.')
  44. })
  45. ```
  46. You specify a root directory to walk and optionally specify a function to prune
  47. sub-directory trees via the `filterDir` function. The Walker exposes a number
  48. of events, broadcasting various file type events a generic error event and
  49. finally the event to signal the end of the process.