{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/212883302","pull_request_review_id":149601521,"id":212883302,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjg4MzMwMg==","diff_hunk":"@@ -625,6 +625,15 @@ Path to the file used to store the persistent REPL history. The default path is\n `~/.node_repl_history`, which is overridden by this variable. Setting the value\n to an empty string (`''` or `' '`) disables persistent REPL history.\n \n+### `NODE_V8_COVERAGE=dir`\n+\n+When set, Node.js will begin outputting [V8 JavaScript code coverage][] to the","path":"doc/api/cli.md","position":6,"original_position":6,"commit_id":"5860e50f11ed4fe65b93b2e9367c6a85d45d7b08","original_commit_id":"03a78332236fc2ac9a8dfed29aefb386773f445f","user":{"login":"schuay","id":36006,"node_id":"MDQ6VXNlcjM2MDA2","avatar_url":"https://avatars0.githubusercontent.com/u/36006?v=4","gravatar_id":"","url":"https://api.github.com/users/schuay","html_url":"https://github.com/schuay","followers_url":"https://api.github.com/users/schuay/followers","following_url":"https://api.github.com/users/schuay/following{/other_user}","gists_url":"https://api.github.com/users/schuay/gists{/gist_id}","starred_url":"https://api.github.com/users/schuay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuay/subscriptions","organizations_url":"https://api.github.com/users/schuay/orgs","repos_url":"https://api.github.com/users/schuay/repos","events_url":"https://api.github.com/users/schuay/events{/privacy}","received_events_url":"https://api.github.com/users/schuay/received_events","type":"User","site_admin":false},"body":"Great to see this :+1: \r\n\r\nThe inspector protocol documentation [here](https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-takePreciseCoverage) is the source of truth. In particular, `takePreciseCoverage` will return an array of `ScriptCoverage` [objects](https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage). \r\n\r\nI'm not sure what DevTools' policies on protocol changes are. You could try asking on their mailing list: https://groups.google.com/forum/#!forum/google-chrome-developer-tools.","created_at":"2018-08-27T07:08:33Z","updated_at":"2018-08-27T07:08:33Z","html_url":"https://github.com/nodejs/node/pull/22527#discussion_r212883302","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/22527","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/212883302"},"html":{"href":"https://github.com/nodejs/node/pull/22527#discussion_r212883302"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/22527"}},"in_reply_to_id":212811262},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/22527","id":210925153,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwOTI1MTUz","html_url":"https://github.com/nodejs/node/pull/22527","diff_url":"https://github.com/nodejs/node/pull/22527.diff","patch_url":"https://github.com/nodejs/node/pull/22527.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/22527","number":22527,"state":"open","locked":false,"title":"coverage: expose native V8 coverage","user":{"login":"bcoe","id":194609,"node_id":"MDQ6VXNlcjE5NDYwOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/194609?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"body":"This pull request is again part of an ongoing initiative to improve the Node.js for those building [developer tools](https://github.com/nodejs/user-feedback/tree/master/groups/tooling) (CC: @bengl, @boneskull).\r\n\r\n---\r\n\r\n## What is this?\r\n\r\nFor some time now, V8 has exposed test coverage through the inspector protocol. This pull request makes it possible to have this information output to disk by setting the environment variable `NODE_V8_COVERAGE=./coverage-directory`.\r\n\r\nBy moving this logic into Node.js itself, we're able to better hook `process.exit()`, signal-handling, and `child_process.spawn()`; this is awesome, because this behavior was previously facilitated by a handful of horrible hacks:\r\n\r\n* [spawn-wrap](https://www.npmjs.com/package/spawn-wrap).\r\n* [signal-exit](https://www.npmjs.com/package/signal-exit).\r\n\r\nGoing forward a tool similar to [nyc](https://www.npmjs.com/package/nyc) will simply be able to consume the raw V8 coverage information, and output Istanbul coverage reports.\r\n\r\n## Help with code review\r\n\r\n@nodejs/v8-inspector I rely on some of the behavior that the inspector API is currently exhibiting, mainly that coverage is output in a single tick of the event loop:\r\n\r\n```js\r\n    session.post('Profiler.takePreciseCoverage', (err, coverageInfo) => {\r\n      try {\r\n        if (err) throw err;\r\n        writeFileSync(target, JSON.stringify(coverageInfo));\r\n      } catch (err) {\r\n        console.error(err);\r\n      }\r\n    });\r\n```\r\n\r\nIt would be wonderful to have some folks double check my work.\r\n\r\nI'm also looping in several folks who've been involved with Istanbul and nyc over the years.\r\n\r\n@isaacs, @addaleax, @schuay.\r\n\r\n<!--\r\nThank you for your pull request. Please provide a description above and review\r\nthe requirements below.\r\n\r\nBug fixes and new features should include tests and possibly benchmarks.\r\n\r\nContributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [ ] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)\r\n","created_at":"2018-08-25T23:05:06Z","updated_at":"2018-08-27T07:08:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"266ac2718187db5970fa37c44491979307b58ba2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"MylesBorins","id":498775,"node_id":"MDQ6VXNlcjQ5ODc3NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/498775?v=4","gravatar_id":"","url":"https://api.github.com/users/MylesBorins","html_url":"https://github.com/MylesBorins","followers_url":"https://api.github.com/users/MylesBorins/followers","following_url":"https://api.github.com/users/MylesBorins/following{/other_user}","gists_url":"https://api.github.com/users/MylesBorins/gists{/gist_id}","starred_url":"https://api.github.com/users/MylesBorins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MylesBorins/subscriptions","organizations_url":"https://api.github.com/users/MylesBorins/orgs","repos_url":"https://api.github.com/users/MylesBorins/repos","events_url":"https://api.github.com/users/MylesBorins/events{/privacy}","received_events_url":"https://api.github.com/users/MylesBorins/received_events","type":"User","site_admin":false},{"login":"Trott","id":718899,"node_id":"MDQ6VXNlcjcxODg5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/718899?v=4","gravatar_id":"","url":"https://api.github.com/users/Trott","html_url":"https://github.com/Trott","followers_url":"https://api.github.com/users/Trott/followers","following_url":"https://api.github.com/users/Trott/following{/other_user}","gists_url":"https://api.github.com/users/Trott/gists{/gist_id}","starred_url":"https://api.github.com/users/Trott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trott/subscriptions","organizations_url":"https://api.github.com/users/Trott/orgs","repos_url":"https://api.github.com/users/Trott/repos","events_url":"https://api.github.com/users/Trott/events{/privacy}","received_events_url":"https://api.github.com/users/Trott/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":386816750,"node_id":"MDU6TGFiZWwzODY4MTY3NTA=","url":"https://api.github.com/repos/nodejs/node/labels/inspector","name":"inspector","color":"bfd4f2","default":false},{"id":281232761,"node_id":"MDU6TGFiZWwyODEyMzI3NjE=","url":"https://api.github.com/repos/nodejs/node/labels/lib%20/%20src","name":"lib / src","color":"fad8c7","default":false},{"id":169485478,"node_id":"MDU6TGFiZWwxNjk0ODU0Nzg=","url":"https://api.github.com/repos/nodejs/node/labels/semver-minor","name":"semver-minor","color":"fef2c0","default":false},{"id":176240519,"node_id":"MDU6TGFiZWwxNzYyNDA1MTk=","url":"https://api.github.com/repos/nodejs/node/labels/test","name":"test","color":"990099","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/22527/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/22527/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/22527/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/5860e50f11ed4fe65b93b2e9367c6a85d45d7b08","head":{"label":"bcoe:coverage","ref":"coverage","sha":"5860e50f11ed4fe65b93b2e9367c6a85d45d7b08","user":{"login":"bcoe","id":194609,"node_id":"MDQ6VXNlcjE5NDYwOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/194609?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"repo":{"id":102437580,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI0Mzc1ODA=","name":"node-1","full_name":"bcoe/node-1","owner":{"login":"bcoe","id":194609,"node_id":"MDQ6VXNlcjE5NDYwOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/194609?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bcoe/node-1","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/bcoe/node-1","forks_url":"https://api.github.com/repos/bcoe/node-1/forks","keys_url":"https://api.github.com/repos/bcoe/node-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bcoe/node-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bcoe/node-1/teams","hooks_url":"https://api.github.com/repos/bcoe/node-1/hooks","issue_events_url":"https://api.github.com/repos/bcoe/node-1/issues/events{/number}","events_url":"https://api.github.com/repos/bcoe/node-1/events","assignees_url":"https://api.github.com/repos/bcoe/node-1/assignees{/user}","branches_url":"https://api.github.com/repos/bcoe/node-1/branches{/branch}","tags_url":"https://api.github.com/repos/bcoe/node-1/tags","blobs_url":"https://api.github.com/repos/bcoe/node-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bcoe/node-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bcoe/node-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/bcoe/node-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bcoe/node-1/statuses/{sha}","languages_url":"https://api.github.com/repos/bcoe/node-1/languages","stargazers_url":"https://api.github.com/repos/bcoe/node-1/stargazers","contributors_url":"https://api.github.com/repos/bcoe/node-1/contributors","subscribers_url":"https://api.github.com/repos/bcoe/node-1/subscribers","subscription_url":"https://api.github.com/repos/bcoe/node-1/subscription","commits_url":"https://api.github.com/repos/bcoe/node-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/bcoe/node-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/bcoe/node-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/bcoe/node-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/bcoe/node-1/contents/{+path}","compare_url":"https://api.github.com/repos/bcoe/node-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bcoe/node-1/merges","archive_url":"https://api.github.com/repos/bcoe/node-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bcoe/node-1/downloads","issues_url":"https://api.github.com/repos/bcoe/node-1/issues{/number}","pulls_url":"https://api.github.com/repos/bcoe/node-1/pulls{/number}","milestones_url":"https://api.github.com/repos/bcoe/node-1/milestones{/number}","notifications_url":"https://api.github.com/repos/bcoe/node-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bcoe/node-1/labels{/name}","releases_url":"https://api.github.com/repos/bcoe/node-1/releases{/id}","deployments_url":"https://api.github.com/repos/bcoe/node-1/deployments","created_at":"2017-09-05T05:23:57Z","updated_at":"2018-08-25T22:46:39Z","pushed_at":"2018-08-26T00:34:52Z","git_url":"git://github.com/bcoe/node-1.git","ssh_url":"git@github.com:bcoe/node-1.git","clone_url":"https://github.com/bcoe/node-1.git","svn_url":"https://github.com/bcoe/node-1","homepage":"https://nodejs.org","size":382200,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"e10290cc67edd5118d4d72efa5336dc2ba652d05","user":{"login":"nodejs","id":9950313,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTAzMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"node_id":"MDEwOlJlcG9zaXRvcnkyNzE5Mzc3OQ==","name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTAzMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2018-08-27T06:59:52Z","pushed_at":"2018-08-27T06:46:37Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":403594,"stargazers_count":52681,"watchers_count":52681,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11154,"mirror_url":null,"archived":false,"open_issues_count":868,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":11154,"open_issues":868,"watchers":52681,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/22527"},"html":{"href":"https://github.com/nodejs/node/pull/22527"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/22527"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/22527/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/22527/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/22527/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/5860e50f11ed4fe65b93b2e9367c6a85d45d7b08"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"schuay"}}