fsevents
Advanced tools
Comparing version 0.1.1 to 0.1.3
@@ -1,5 +0,10 @@ | ||
Native Access to Mac OS-X FSEvents - Change-Log | ||
================================= | ||
# Native Access to Mac OS-X FSEvents - Change-Log | ||
## Version 0.0.1 | ||
* Basic functionality | ||
## Version 0.1.2 | ||
* Finally made the Jump to node 0.8+ with this module. | ||
* Much more Event-Details |
@@ -0,1 +1,5 @@ | ||
/* | ||
** © 2013 by Philipp Dunkel <p.dunkel@me.com>. Licensed under MIT License. | ||
*/ | ||
var util = require('util'); | ||
@@ -10,2 +14,4 @@ var events = require('events'); | ||
var Fs = require('fs'); | ||
module.exports = function(path) { | ||
@@ -30,4 +36,17 @@ var fsevents = new FSEvents(path); | ||
} | ||
fsevents.emit('change', path, info); | ||
fsevents.emit(info.event, path, info); | ||
if (info.event == 'moved') { | ||
Fs.stat(info.event, function(err, stat) { | ||
if (err || !stat) { | ||
info.event = 'moved-out'; | ||
} else { | ||
info.event = 'moved-in'; | ||
} | ||
fsevents.emit('change', path, info); | ||
fsevents.emit(info.event, path, info); | ||
}); | ||
} else { | ||
fsevents.emit('change', path, info); | ||
if (info.event !== 'unknown') fsevents.emit(info.event, path, info); | ||
} | ||
}); | ||
@@ -34,0 +53,0 @@ return fsevents; |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/phidelta/NodeJS-FSEvents", | ||
"version": "0.1.1", | ||
"version": "0.1.3", | ||
"maintainers": [ | ||
@@ -21,10 +21,8 @@ "Philipp Dunkel <phidelta@phideltacity.net>" | ||
], | ||
"repositories": [ | ||
{ | ||
"type": "git", | ||
"url": "https://github.com/phidelta/NodeJS-FSEvents.git" | ||
} | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/phidelta/NodeJS-FSEvents.git" | ||
}, | ||
"main": "./fsevents.js", | ||
"engines": {"node": ">=0.8"} | ||
} |
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
15078
63
72
7