Skip to content

Commit 240fdd8

Browse files
committed
Make watching configurable and false by default.
1 parent ace98b8 commit 240fdd8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ function Pointer(obj) {
115115
},
116116
__stopWatch: {
117117
value: function () {
118-
watcher.close();
118+
if (watcher) {
119+
watcher.close();
120+
}
119121
}
120122
},
121123
__startWatch: {
@@ -124,7 +126,9 @@ function Pointer(obj) {
124126
}
125127
}
126128
});
127-
self.__startWatch();
129+
if (opts.watch) {
130+
self.__startWatch();
131+
}
128132
// Watcher is unstable, have to renew after each event
129133
var watcher = null;
130134

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"files",
88
"pointer"
99
],
10-
"version": "0.0.2",
10+
"version": "0.0.3",
1111
"repository": {
1212
"type": "git",
1313
"url": "git@github.com:DeadAlready/node-file-pointer"

0 commit comments

Comments
 (0)