kessler / node-regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
MIT License
277 stars 45 forks source link

Streaming Function is redundant, when there is no registry key found. #17

Closed vincent1173 closed 2 years ago

vincent1173 commented 8 years ago

Hi, I'm trying to find whether the registry key exists using regedit.

 regedit.list(/*reg key here */)
    .on('data',function(data) {
      console.log("data found");
    })
    .on('error',function(error){console.log("error!")})
    .on('finish',function() {console.log("Finish");});

But, the control doesn't fall to finish , when no suck key is found. Instead, it prints 'error' twice.

kessler commented 8 years ago

@vincentdass is the problem resolved?

vincent1173 commented 7 years ago

No, it fails by printing error twice. But I made few changes in my error handler to resolve the issue.

kessler commented 7 years ago

@vincentdass could you send a PR or share the code here?

kessler commented 2 years ago

tested, not an issue anymore (don't know why though... :-( )