Comparing version
const { promises: fs } = require('fs'); | ||
const path = require('path'); | ||
const { promisify } = require('util'); | ||
const NSFW = require('../../build/Release/nsfw.node'); | ||
const { NSFW } = require('../../build/Release/nsfw.node'); | ||
@@ -74,3 +75,3 @@ function NSFWFilePoller(watchPath, eventCallback, debounceMS) { | ||
if (stats.isDirectory()) { | ||
return new NSFW(watchPath, eventCallback, { debounceMS, errorCallback }); | ||
return new NSFW(debounceMS, watchPath, eventCallback, errorCallback); | ||
} else if (stats.isFile()) { | ||
@@ -89,5 +90,9 @@ return new NSFWFilePoller(watchPath, eventCallback, debounceMS); | ||
const implementation = watchPath; | ||
this.start = () => implementation.start(); | ||
this.stop = () => implementation.stop(); | ||
if (implementation instanceof NSFW) { | ||
this.start = promisify((callback) => implementation.start(callback)); | ||
this.stop = promisify((callback) => implementation.stop(callback)); | ||
} else { | ||
this.start = () => implementation.start(); | ||
this.stop = () => implementation.stop(); | ||
} | ||
} | ||
@@ -94,0 +99,0 @@ |
{ | ||
"name": "nsfw", | ||
"version": "1.2.8", | ||
"version": "1.2.9", | ||
"description": "A simple file watcher for Node", | ||
@@ -29,3 +29,3 @@ "main": "js/src/index.js", | ||
"dependencies": { | ||
"node-addon-api": "*" | ||
"nan": "^2.0.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
73988
1.67%144
4.35%0
-100%+ Added
+ Added
- Removed
- Removed