{"action":"created","issue":{"url":"https://api.github.com/repos/cowboy/node-exit/issues/7","repository_url":"https://api.github.com/repos/cowboy/node-exit","labels_url":"https://api.github.com/repos/cowboy/node-exit/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/cowboy/node-exit/issues/7/comments","events_url":"https://api.github.com/repos/cowboy/node-exit/issues/7/events","html_url":"https://github.com/cowboy/node-exit/issues/7","id":23338290,"number":7,"title":"process.on(\"exit\", fn) not being respected","user":{"login":"cowboy","id":54051,"avatar_url":"https://avatars0.githubusercontent.com/u/54051?v=4","gravatar_id":"","url":"https://api.github.com/users/cowboy","html_url":"https://github.com/cowboy","followers_url":"https://api.github.com/users/cowboy/followers","following_url":"https://api.github.com/users/cowboy/following{/other_user}","gists_url":"https://api.github.com/users/cowboy/gists{/gist_id}","starred_url":"https://api.github.com/users/cowboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowboy/subscriptions","organizations_url":"https://api.github.com/users/cowboy/orgs","repos_url":"https://api.github.com/users/cowboy/repos","events_url":"https://api.github.com/users/cowboy/events{/privacy}","received_events_url":"https://api.github.com/users/cowboy/received_events","type":"User","site_admin":false},"labels":[{"id":57310138,"url":"https://api.github.com/repos/cowboy/node-exit/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2013-11-26T19:08:02Z","updated_at":"2018-03-29T10:08:36Z","closed_at":null,"author_association":"OWNER","body":"See sindresorhus/time-grunt#15.\n\nGiven the following code:\n\n``` js\nconsole.log(\"before\");\nprocess.on(\"exit\", function() {\n  console.log(\"on exit\");\n});\nprocess.exit();\nconsole.log(\"after\");\n```\n- In non-Windows Node.js, this properly logs `before` then `on exit`.\n- In Windows Node.js, this might log nothing, all three things, or some combination of them. Kinda random, depends on the shell, if output is piped or not, etc.\n- With `require(\"exit\")();` instead of `process.exit();` only `before` is logged. **`on exit` should be logged.**\n\nTake a look at this [commit in the node-exit branch](https://github.com/cowboy/node-exit/commit/e90e70e21bacb35c970c5cd92debdaece794eebc).\n\nGranted, that code is currently failing... but if we can fix it, we might be able to allow @sindresorhus's plugin to continue working.\n\nPossible solution: Set `stream.write` to a NOP function _after_ the `exit` event has been called?\n"},"comment":{"url":"https://api.github.com/repos/cowboy/node-exit/issues/comments/377188646","html_url":"https://github.com/cowboy/node-exit/issues/7#issuecomment-377188646","issue_url":"https://api.github.com/repos/cowboy/node-exit/issues/7","id":377188646,"user":{"login":"ArmorDarks","id":4460311,"avatar_url":"https://avatars1.githubusercontent.com/u/4460311?v=4","gravatar_id":"","url":"https://api.github.com/users/ArmorDarks","html_url":"https://github.com/ArmorDarks","followers_url":"https://api.github.com/users/ArmorDarks/followers","following_url":"https://api.github.com/users/ArmorDarks/following{/other_user}","gists_url":"https://api.github.com/users/ArmorDarks/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmorDarks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmorDarks/subscriptions","organizations_url":"https://api.github.com/users/ArmorDarks/orgs","repos_url":"https://api.github.com/users/ArmorDarks/repos","events_url":"https://api.github.com/users/ArmorDarks/events{/privacy}","received_events_url":"https://api.github.com/users/ArmorDarks/received_events","type":"User","site_admin":false},"created_at":"2018-03-29T10:08:36Z","updated_at":"2018-03-29T10:08:36Z","author_association":"NONE","body":"Oh my, and I was wondering why\r\n\r\n```\r\nprocess.on('exit', () => {\r\n    console.log(\"on exit\")\r\n})\r\n```\r\n\r\ninside my task isn't doing anything. So, Grunt v1.0.0 is affected by this, right?"}}
{"actor":{"display_login":"ArmorDarks"}}