Comparing version 1.2.8 to 1.2.9
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
144
0
+ Addednan@^2.0.0
+ Addednan@2.22.0(transitive)
- Removednode-addon-api@*
- Removednode-addon-api@8.3.0(transitive)