{"action":"opened","issue":{"url":"https://api.github.com/repos/MadLittleMods/node-usb-detection/issues/35","repository_url":"https://api.github.com/repos/MadLittleMods/node-usb-detection","labels_url":"https://api.github.com/repos/MadLittleMods/node-usb-detection/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/MadLittleMods/node-usb-detection/issues/35/comments","events_url":"https://api.github.com/repos/MadLittleMods/node-usb-detection/issues/35/events","html_url":"https://github.com/MadLittleMods/node-usb-detection/issues/35","id":195126793,"number":35,"title":"Library makes `process.exit()` freeze","user":{"login":"sebakerckhof","id":88471,"avatar_url":"https://avatars.githubusercontent.com/u/88471?v=3","gravatar_id":"","url":"https://api.github.com/users/sebakerckhof","html_url":"https://github.com/sebakerckhof","followers_url":"https://api.github.com/users/sebakerckhof/followers","following_url":"https://api.github.com/users/sebakerckhof/following{/other_user}","gists_url":"https://api.github.com/users/sebakerckhof/gists{/gist_id}","starred_url":"https://api.github.com/users/sebakerckhof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebakerckhof/subscriptions","organizations_url":"https://api.github.com/users/sebakerckhof/orgs","repos_url":"https://api.github.com/users/sebakerckhof/repos","events_url":"https://api.github.com/users/sebakerckhof/events{/privacy}","received_events_url":"https://api.github.com/users/sebakerckhof/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-13T00:30:19Z","updated_at":"2016-12-13T00:30:19Z","closed_at":null,"body":"I have a simple test script like:\r\n```js\r\nsetTimeout(() => {\r\n  process.exit(0);\r\n},5000);\r\n```\r\nThis works 100% of the times (after 5s the node process stops).\r\n\r\nWhen I now include this library, like:\r\n```js\r\nconst usbDetection = require('usb-detection');\r\n\r\nusbDetection.on('add', device => { console.log('added', device); } );\r\nusbDetection.on('remove', device => { console.log('removed', device) });\r\n\r\nsetTimeout(() => {\r\n  process.exit(0);\r\n},5000);\r\n```\r\n\r\nThe process hangs most of the times after 5s instead of exiting.\r\n"}}
{"actor":{"display_login":"sebakerckhof"}}