{"action":"created","comment":{"url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/comments/241954104","pull_request_review_id":185359724,"id":241954104,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTk1NDEwNA==","diff_hunk":"@@ -75,8 +91,19 @@ async function convert(inputFile, options, timings) {\n     if (format) {\n       pdfOptions.format = format // Paper format. If set, takes priority over width or height options. Defaults to 'Letter'.\n     }\n-    return await page.pdf(pdfOptions)\n+    await page.pdf(pdfOptions)\n   } finally {\n+    if (outputToStdout && await existsFile(outputFile)) {\n+      console.log(await readFile(outputFile, 'utf-8'))\n+      await removeFile(outputFile)","path":"lib/converter.js","position":105,"original_position":105,"commit_id":"6a00dcb4b6d7d0d1d2dab689e8c089368fe49512","original_commit_id":"6a00dcb4b6d7d0d1d2dab689e8c089368fe49512","user":{"login":"matklad","id":1711539,"node_id":"MDQ6VXNlcjE3MTE1Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1711539?v=4","gravatar_id":"","url":"https://api.github.com/users/matklad","html_url":"https://github.com/matklad","followers_url":"https://api.github.com/users/matklad/followers","following_url":"https://api.github.com/users/matklad/following{/other_user}","gists_url":"https://api.github.com/users/matklad/gists{/gist_id}","starred_url":"https://api.github.com/users/matklad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matklad/subscriptions","organizations_url":"https://api.github.com/users/matklad/orgs","repos_url":"https://api.github.com/users/matklad/repos","events_url":"https://api.github.com/users/matklad/events{/privacy}","received_events_url":"https://api.github.com/users/matklad/received_events","type":"User","site_admin":false},"body":"Curious: does JavaScript have some kind of try-with-resources (as in Java) / with (as in Python) analogue? As written, there's a theoretical possibility that `readFile` throws, and `outFile` doesn't get removed. ","created_at":"2018-12-15T16:25:36Z","updated_at":"2018-12-15T16:32:46Z","html_url":"https://github.com/Mogztter/asciidoctor-pdf.js/pull/33#discussion_r241954104","pull_request_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/comments/241954104"},"html":{"href":"https://github.com/Mogztter/asciidoctor-pdf.js/pull/33#discussion_r241954104"},"pull_request":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33","id":237141384,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTQxMzg0","html_url":"https://github.com/Mogztter/asciidoctor-pdf.js/pull/33","diff_url":"https://github.com/Mogztter/asciidoctor-pdf.js/pull/33.diff","patch_url":"https://github.com/Mogztter/asciidoctor-pdf.js/pull/33.patch","issue_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/33","number":33,"state":"open","locked":false,"title":"Resolves #17, Resolves #18, Support --destination-dir --out-file","user":{"login":"Mogztter","id":333276,"node_id":"MDQ6VXNlcjMzMzI3Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/333276?v=4","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"body":"ping @matklad :wink: \r\n\r\nSo the following is supported:\r\n\r\n```\r\n-o foo/bar/baz/book.pdf\r\n```\r\nWill create `foo`, `bar` and `baz` directories (if they don't exist).\r\n\r\n```\r\n-o ''\r\n```\r\n\r\nWill output the result (pdf content) to the console\r\n\r\n```\r\n-D foo/bar/baz -o book.pdf\r\n```\r\nWill create `foo`, `bar` and `baz` directories (if they don't exist).\r\n\r\n```\r\n-o book.pdf\r\n```\r\nWill create a file named `book.pdf`\r\n\r\n\r\nPlease note that for now we do not remove the temporary HTML file (to ease development/debugging).\r\nAlso the temporary HTML file is always created next to the input file. So you don't have to update the relative paths when you want to output the PDF file somewhere else.\r\n","created_at":"2018-12-09T16:34:34Z","updated_at":"2018-12-15T16:32:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd79e60b5ba40c238b8097b58a7b679f64e843a5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33/commits","review_comments_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33/comments","review_comment_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/33/comments","statuses_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/statuses/6a00dcb4b6d7d0d1d2dab689e8c089368fe49512","head":{"label":"Mogztter:mkdirs-destination-to-file-support","ref":"mkdirs-destination-to-file-support","sha":"6a00dcb4b6d7d0d1d2dab689e8c089368fe49512","user":{"login":"Mogztter","id":333276,"node_id":"MDQ6VXNlcjMzMzI3Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/333276?v=4","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"repo":{"id":132326017,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIzMjYwMTc=","name":"asciidoctor-pdf.js","full_name":"Mogztter/asciidoctor-pdf.js","private":false,"owner":{"login":"Mogztter","id":333276,"node_id":"MDQ6VXNlcjMzMzI3Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/333276?v=4","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Mogztter/asciidoctor-pdf.js","description":"Asciidoctor.js PDF: A PDF converter for AsciiDoc based on Asciidoctor.js. https://asciidoctor.org","fork":false,"url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js","forks_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/forks","keys_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/teams","hooks_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/hooks","issue_events_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/events","assignees_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/tags","blobs_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/languages","stargazers_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/stargazers","contributors_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/contributors","subscribers_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/subscribers","subscription_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/subscription","commits_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/merges","archive_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/downloads","issues_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/releases{/id}","deployments_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/deployments","created_at":"2018-05-06T09:53:57Z","updated_at":"2018-12-09T14:48:24Z","pushed_at":"2018-12-09T16:34:35Z","git_url":"git://github.com/Mogztter/asciidoctor-pdf.js.git","ssh_url":"git@github.com:Mogztter/asciidoctor-pdf.js.git","clone_url":"https://github.com/Mogztter/asciidoctor-pdf.js.git","svn_url":"https://github.com/Mogztter/asciidoctor-pdf.js","homepage":null,"size":18285,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":11,"watchers":7,"default_branch":"master"}},"base":{"label":"Mogztter:master","ref":"master","sha":"f75691588c8a3777e69b238fdd484ee4375dc568","user":{"login":"Mogztter","id":333276,"node_id":"MDQ6VXNlcjMzMzI3Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/333276?v=4","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"repo":{"id":132326017,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIzMjYwMTc=","name":"asciidoctor-pdf.js","full_name":"Mogztter/asciidoctor-pdf.js","private":false,"owner":{"login":"Mogztter","id":333276,"node_id":"MDQ6VXNlcjMzMzI3Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/333276?v=4","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Mogztter/asciidoctor-pdf.js","description":"Asciidoctor.js PDF: A PDF converter for AsciiDoc based on Asciidoctor.js. https://asciidoctor.org","fork":false,"url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js","forks_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/forks","keys_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/teams","hooks_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/hooks","issue_events_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/events","assignees_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/tags","blobs_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/languages","stargazers_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/stargazers","contributors_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/contributors","subscribers_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/subscribers","subscription_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/subscription","commits_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/merges","archive_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/downloads","issues_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/releases{/id}","deployments_url":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/deployments","created_at":"2018-05-06T09:53:57Z","updated_at":"2018-12-09T14:48:24Z","pushed_at":"2018-12-09T16:34:35Z","git_url":"git://github.com/Mogztter/asciidoctor-pdf.js.git","ssh_url":"git@github.com:Mogztter/asciidoctor-pdf.js.git","clone_url":"https://github.com/Mogztter/asciidoctor-pdf.js.git","svn_url":"https://github.com/Mogztter/asciidoctor-pdf.js","homepage":null,"size":18285,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":11,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33"},"html":{"href":"https://github.com/Mogztter/asciidoctor-pdf.js/pull/33"},"issue":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/33"},"comments":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/Mogztter/asciidoctor-pdf.js/statuses/6a00dcb4b6d7d0d1d2dab689e8c089368fe49512"}},"author_association":"OWNER"}}
{"actor":{"display_login":"matklad"}}