+6
-0
@@ -19,2 +19,8 @@ var filewatcher = require('filewatcher') | ||
| watcher.on('change', fileChanged) | ||
| yolo.close = function () { | ||
| dirs.removeAll() | ||
| watcher.removeAll() | ||
| } | ||
| return yolo | ||
@@ -21,0 +27,0 @@ |
+10
-3
| { | ||
| "name": "yolowatch", | ||
| "version": "2.3.0", | ||
| "version": "2.4.0", | ||
| "description": "watch filesystem changes yolostyle", | ||
@@ -14,3 +14,2 @@ "main": "index.js", | ||
| "folder-walker": "^2.1.1", | ||
| "from2": "^2.1.1", | ||
| "stream-each": "^1.1.2" | ||
@@ -23,3 +22,11 @@ }, | ||
| "tape": "^4.6.0" | ||
| } | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git://github.com/karissa/yolowatch.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/karissa/yolowatch/issues" | ||
| }, | ||
| "homepage": "https://github.com/karissa/yolowatch#readme" | ||
| } |
+2
-5
@@ -30,2 +30,4 @@ # yolowatch | ||
| }) | ||
| watcher.close() // remove all listeners | ||
| ``` | ||
@@ -50,6 +52,1 @@ | ||
| * Ignore files: `opts.filter` passed to folder-walker. | ||
| ### Todo | ||
| * expose options to pass to filewatcher module (check this) | ||
| * function to remove directory & children from being watched. |
+7
-2
@@ -9,3 +9,2 @@ var fs = require('fs') | ||
| var dir = path.join(os.tmpdir(), 'yolotest') | ||
| var opts = {persistent: false} | ||
@@ -20,3 +19,3 @@ var i = 0 | ||
| fStart = createFile() | ||
| watcher = yoloWatch(dir, opts) | ||
| watcher = yoloWatch(dir) | ||
| t.end() | ||
@@ -46,2 +45,8 @@ }) | ||
| test('close removes listeners', function (t) { | ||
| t.doesNotThrow(watcher.close, 'close ok') | ||
| t.timeoutAfter(100) | ||
| t.end() | ||
| }) | ||
| function createFile () { | ||
@@ -48,0 +53,0 @@ var n = path.join(dir, 'tmp00' + (i++)) |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4240
7.18%3
-25%95
9.2%2
-33.33%0
-100%1
-50%51
-5.56%- Removed