{"action":"created","comment":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/comments/124623427","pull_request_review_id":46931020,"id":124623427,"diff_hunk":"@@ -297,6 +297,26 @@ of mangled property names.\n Using the name cache is not necessary if you compress all your files in a\n single call to UglifyJS.\n \n+When using `minify()`, you may specify `--name-cache` in the following way:\n+\n+```javascript\n+var options = {\n+    mangle: {\n+        properties: true,\n+    },\n+    nameCache: JSON.parse(fs.readFileSync(\"/tmp/cache.json\", \"utf8\"))\n+};\n+fs.writeFileSync(\"part1.js\", UglifyJS.minify({\n+    \"file1.js\": fs.readFileSync(\"file1.js\", \"utf8\"),\n+    \"file2.js\": fs.readFileSync(\"file2.js\", \"utf8\")\n+}, options), \"utf8\");\n+fs.writeFileSync(\"part2.js\", UglifyJS.minify({\n+    \"file3.js\": fs.readFileSync(\"file3.js\", \"utf8\"),\n+    \"file4.js\": fs.readFileSync(\"file4.js\", \"utf8\")\n+}, options), \"utf8\");\n+fs.writeFileSync(\"/tmp/cache.json\", JSON.stringify(options.nameCache), \"utf8\");","path":"README.md","position":21,"original_position":21,"commit_id":"4629d504eb01e2901add421eaecc6a0d4e8698c4","original_commit_id":"4629d504eb01e2901add421eaecc6a0d4e8698c4","user":{"login":"kzc","id":11593452,"avatar_url":"https://avatars0.githubusercontent.com/u/11593452?v=3","gravatar_id":"","url":"https://api.github.com/users/kzc","html_url":"https://github.com/kzc","followers_url":"https://api.github.com/users/kzc/followers","following_url":"https://api.github.com/users/kzc/following{/other_user}","gists_url":"https://api.github.com/users/kzc/gists{/gist_id}","starred_url":"https://api.github.com/users/kzc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kzc/subscriptions","organizations_url":"https://api.github.com/users/kzc/orgs","repos_url":"https://api.github.com/users/kzc/repos","events_url":"https://api.github.com/users/kzc/events{/privacy}","received_events_url":"https://api.github.com/users/kzc/received_events","type":"User","site_admin":false},"body":"Could you put \"/tmp/cache.json\" in a variable `cacheFileName` at the top of the example so the path is not repeated twice?","created_at":"2017-06-28T18:43:11Z","updated_at":"2017-06-28T18:43:11Z","html_url":"https://github.com/mishoo/UglifyJS2/pull/2176#discussion_r124623427","pull_request_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176","_links":{"self":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/comments/124623427"},"html":{"href":"https://github.com/mishoo/UglifyJS2/pull/2176#discussion_r124623427"},"pull_request":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176"}}},"pull_request":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176","id":127968157,"html_url":"https://github.com/mishoo/UglifyJS2/pull/2176","diff_url":"https://github.com/mishoo/UglifyJS2/pull/2176.diff","patch_url":"https://github.com/mishoo/UglifyJS2/pull/2176.patch","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2176","number":2176,"state":"open","locked":false,"title":"[WIP] improve usability of name cache under `minify()`","user":{"login":"alexlamsl","id":1898413,"avatar_url":"https://avatars0.githubusercontent.com/u/1898413?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlamsl","html_url":"https://github.com/alexlamsl","followers_url":"https://api.github.com/users/alexlamsl/followers","following_url":"https://api.github.com/users/alexlamsl/following{/other_user}","gists_url":"https://api.github.com/users/alexlamsl/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlamsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlamsl/subscriptions","organizations_url":"https://api.github.com/users/alexlamsl/orgs","repos_url":"https://api.github.com/users/alexlamsl/repos","events_url":"https://api.github.com/users/alexlamsl/events{/privacy}","received_events_url":"https://api.github.com/users/alexlamsl/received_events","type":"User","site_admin":false},"body":"fixes #2174\r\n\r\n@kzc just a starting point for discussion on https://github.com/mishoo/UglifyJS2/issues/2174#issuecomment-311688768","created_at":"2017-06-28T16:41:16Z","updated_at":"2017-06-28T18:43:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ac968e2ea8c6ee1ec2089e05500d44910e50b4a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176/commits","review_comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176/comments","review_comment_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2176/comments","statuses_url":"https://api.github.com/repos/mishoo/UglifyJS2/statuses/4629d504eb01e2901add421eaecc6a0d4e8698c4","head":{"label":"alexlamsl:issue-2174","ref":"issue-2174","sha":"4629d504eb01e2901add421eaecc6a0d4e8698c4","user":{"login":"alexlamsl","id":1898413,"avatar_url":"https://avatars0.githubusercontent.com/u/1898413?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlamsl","html_url":"https://github.com/alexlamsl","followers_url":"https://api.github.com/users/alexlamsl/followers","following_url":"https://api.github.com/users/alexlamsl/following{/other_user}","gists_url":"https://api.github.com/users/alexlamsl/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlamsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlamsl/subscriptions","organizations_url":"https://api.github.com/users/alexlamsl/orgs","repos_url":"https://api.github.com/users/alexlamsl/repos","events_url":"https://api.github.com/users/alexlamsl/events{/privacy}","received_events_url":"https://api.github.com/users/alexlamsl/received_events","type":"User","site_admin":false},"repo":{"id":79024614,"name":"UglifyJS2","full_name":"alexlamsl/UglifyJS2","owner":{"login":"alexlamsl","id":1898413,"avatar_url":"https://avatars0.githubusercontent.com/u/1898413?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlamsl","html_url":"https://github.com/alexlamsl","followers_url":"https://api.github.com/users/alexlamsl/followers","following_url":"https://api.github.com/users/alexlamsl/following{/other_user}","gists_url":"https://api.github.com/users/alexlamsl/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlamsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlamsl/subscriptions","organizations_url":"https://api.github.com/users/alexlamsl/orgs","repos_url":"https://api.github.com/users/alexlamsl/repos","events_url":"https://api.github.com/users/alexlamsl/events{/privacy}","received_events_url":"https://api.github.com/users/alexlamsl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexlamsl/UglifyJS2","description":" JavaScript parser / mangler / compressor / beautifier toolkit","fork":true,"url":"https://api.github.com/repos/alexlamsl/UglifyJS2","forks_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/forks","keys_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/teams","hooks_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/hooks","issue_events_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/issues/events{/number}","events_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/events","assignees_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/assignees{/user}","branches_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/branches{/branch}","tags_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/tags","blobs_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/statuses/{sha}","languages_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/languages","stargazers_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/stargazers","contributors_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/contributors","subscribers_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/subscribers","subscription_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/subscription","commits_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/contents/{+path}","compare_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/merges","archive_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/downloads","issues_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/issues{/number}","pulls_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/pulls{/number}","milestones_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/milestones{/number}","notifications_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/labels{/name}","releases_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/releases{/id}","deployments_url":"https://api.github.com/repos/alexlamsl/UglifyJS2/deployments","created_at":"2017-01-15T10:31:17Z","updated_at":"2017-01-15T10:31:20Z","pushed_at":"2017-06-28T18:38:29Z","git_url":"git://github.com/alexlamsl/UglifyJS2.git","ssh_url":"git@github.com:alexlamsl/UglifyJS2.git","clone_url":"https://github.com/alexlamsl/UglifyJS2.git","svn_url":"https://github.com/alexlamsl/UglifyJS2","homepage":"http://lisperator.net/uglifyjs/","size":4395,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mishoo:master","ref":"master","sha":"5e6f26445f932a180890be4792dab574e07cbb0f","user":{"login":"mishoo","id":334725,"avatar_url":"https://avatars1.githubusercontent.com/u/334725?v=3","gravatar_id":"","url":"https://api.github.com/users/mishoo","html_url":"https://github.com/mishoo","followers_url":"https://api.github.com/users/mishoo/followers","following_url":"https://api.github.com/users/mishoo/following{/other_user}","gists_url":"https://api.github.com/users/mishoo/gists{/gist_id}","starred_url":"https://api.github.com/users/mishoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishoo/subscriptions","organizations_url":"https://api.github.com/users/mishoo/orgs","repos_url":"https://api.github.com/users/mishoo/repos","events_url":"https://api.github.com/users/mishoo/events{/privacy}","received_events_url":"https://api.github.com/users/mishoo/received_events","type":"User","site_admin":false},"repo":{"id":5569059,"name":"UglifyJS2","full_name":"mishoo/UglifyJS2","owner":{"login":"mishoo","id":334725,"avatar_url":"https://avatars1.githubusercontent.com/u/334725?v=3","gravatar_id":"","url":"https://api.github.com/users/mishoo","html_url":"https://github.com/mishoo","followers_url":"https://api.github.com/users/mishoo/followers","following_url":"https://api.github.com/users/mishoo/following{/other_user}","gists_url":"https://api.github.com/users/mishoo/gists{/gist_id}","starred_url":"https://api.github.com/users/mishoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishoo/subscriptions","organizations_url":"https://api.github.com/users/mishoo/orgs","repos_url":"https://api.github.com/users/mishoo/repos","events_url":"https://api.github.com/users/mishoo/events{/privacy}","received_events_url":"https://api.github.com/users/mishoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mishoo/UglifyJS2","description":" JavaScript parser / mangler / compressor / beautifier toolkit","fork":false,"url":"https://api.github.com/repos/mishoo/UglifyJS2","forks_url":"https://api.github.com/repos/mishoo/UglifyJS2/forks","keys_url":"https://api.github.com/repos/mishoo/UglifyJS2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mishoo/UglifyJS2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mishoo/UglifyJS2/teams","hooks_url":"https://api.github.com/repos/mishoo/UglifyJS2/hooks","issue_events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/events{/number}","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/events","assignees_url":"https://api.github.com/repos/mishoo/UglifyJS2/assignees{/user}","branches_url":"https://api.github.com/repos/mishoo/UglifyJS2/branches{/branch}","tags_url":"https://api.github.com/repos/mishoo/UglifyJS2/tags","blobs_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/refs{/sha}","trees_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mishoo/UglifyJS2/statuses/{sha}","languages_url":"https://api.github.com/repos/mishoo/UglifyJS2/languages","stargazers_url":"https://api.github.com/repos/mishoo/UglifyJS2/stargazers","contributors_url":"https://api.github.com/repos/mishoo/UglifyJS2/contributors","subscribers_url":"https://api.github.com/repos/mishoo/UglifyJS2/subscribers","subscription_url":"https://api.github.com/repos/mishoo/UglifyJS2/subscription","commits_url":"https://api.github.com/repos/mishoo/UglifyJS2/commits{/sha}","git_commits_url":"https://api.github.com/repos/mishoo/UglifyJS2/git/commits{/sha}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/comments{/number}","issue_comment_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments{/number}","contents_url":"https://api.github.com/repos/mishoo/UglifyJS2/contents/{+path}","compare_url":"https://api.github.com/repos/mishoo/UglifyJS2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mishoo/UglifyJS2/merges","archive_url":"https://api.github.com/repos/mishoo/UglifyJS2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mishoo/UglifyJS2/downloads","issues_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues{/number}","pulls_url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls{/number}","milestones_url":"https://api.github.com/repos/mishoo/UglifyJS2/milestones{/number}","notifications_url":"https://api.github.com/repos/mishoo/UglifyJS2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/labels{/name}","releases_url":"https://api.github.com/repos/mishoo/UglifyJS2/releases{/id}","deployments_url":"https://api.github.com/repos/mishoo/UglifyJS2/deployments","created_at":"2012-08-27T09:31:03Z","updated_at":"2017-06-28T13:13:26Z","pushed_at":"2017-06-28T18:38:31Z","git_url":"git://github.com/mishoo/UglifyJS2.git","ssh_url":"git@github.com:mishoo/UglifyJS2.git","clone_url":"https://github.com/mishoo/UglifyJS2.git","svn_url":"https://github.com/mishoo/UglifyJS2","homepage":"http://lisperator.net/uglifyjs/","size":4385,"stargazers_count":6839,"watchers_count":6839,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":771,"mirror_url":null,"open_issues_count":48,"forks":771,"open_issues":48,"watchers":6839,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176"},"html":{"href":"https://github.com/mishoo/UglifyJS2/pull/2176"},"issue":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2176"},"comments":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/issues/2176/comments"},"review_comments":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176/comments"},"review_comment":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/2176/commits"},"statuses":{"href":"https://api.github.com/repos/mishoo/UglifyJS2/statuses/4629d504eb01e2901add421eaecc6a0d4e8698c4"}}}}
{"actor":{"display_login":"kzc"}}