{"action":"created","issue":{"url":"https://api.github.com/repos/jprichardson/node-fs-extra/issues/220","repository_url":"https://api.github.com/repos/jprichardson/node-fs-extra","labels_url":"https://api.github.com/repos/jprichardson/node-fs-extra/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/jprichardson/node-fs-extra/issues/220/comments","events_url":"https://api.github.com/repos/jprichardson/node-fs-extra/issues/220/events","html_url":"https://github.com/jprichardson/node-fs-extra/pull/220","id":131995010,"number":220,"title":"Non-breaking feature: add option 'passStats' to copy methods.","user":{"login":"shennan","id":1840398,"avatar_url":"https://avatars.githubusercontent.com/u/1840398?v=3","gravatar_id":"","url":"https://api.github.com/users/shennan","html_url":"https://github.com/shennan","followers_url":"https://api.github.com/users/shennan/followers","following_url":"https://api.github.com/users/shennan/following{/other_user}","gists_url":"https://api.github.com/users/shennan/gists{/gist_id}","starred_url":"https://api.github.com/users/shennan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shennan/subscriptions","organizations_url":"https://api.github.com/users/shennan/orgs","repos_url":"https://api.github.com/users/shennan/repos","events_url":"https://api.github.com/users/shennan/events{/privacy}","received_events_url":"https://api.github.com/users/shennan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-02-07T18:24:11Z","updated_at":"2016-11-07T18:24:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jprichardson/node-fs-extra/pulls/220","html_url":"https://github.com/jprichardson/node-fs-extra/pull/220","diff_url":"https://github.com/jprichardson/node-fs-extra/pull/220.diff","patch_url":"https://github.com/jprichardson/node-fs-extra/pull/220.patch"},"body":"I've found a few use cases where I've wanted to query the file/directory statistics from within the `filter` function handler. Something like this:\n\n``` js\ncopy('some/path', 'other/path', {\n  filter: function (p, stats) {\n    return stats.isDirectory();\n  }\n});\n```\n\nAll sorts of useful information could be garnered from the `stats` object that could inform the decision to skip the path in the `filter` callback. Seeing as the stats are being fetched anyway, it seemed like a pretty straight-forward adjustment for a lot of extra gain.\n\n**_Why make it an option? Why not just pass it?_**\n\nBecause there could be an argument for greater speed in not using it. The `fs.stat` is always called, but in the asynchronous `copy`, the stats are only fetched after the path has been filtered. In the case of passing the `{ passStats: true }`, we can signal to the copy method that we'd like to delay the filter call until further down the chain of checks, so that we can make use of the inevitable call to `fs.stat`.\n\nOn top of the code, I have also altered the docs to reflect the new feature.\n\nLet me know your thoughts.\n"},"comment":{"url":"https://api.github.com/repos/jprichardson/node-fs-extra/issues/comments/258918711","html_url":"https://github.com/jprichardson/node-fs-extra/pull/220#issuecomment-258918711","issue_url":"https://api.github.com/repos/jprichardson/node-fs-extra/issues/220","id":258918711,"user":{"login":"jprichardson","id":150063,"avatar_url":"https://avatars.githubusercontent.com/u/150063?v=3","gravatar_id":"","url":"https://api.github.com/users/jprichardson","html_url":"https://github.com/jprichardson","followers_url":"https://api.github.com/users/jprichardson/followers","following_url":"https://api.github.com/users/jprichardson/following{/other_user}","gists_url":"https://api.github.com/users/jprichardson/gists{/gist_id}","starred_url":"https://api.github.com/users/jprichardson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jprichardson/subscriptions","organizations_url":"https://api.github.com/users/jprichardson/orgs","repos_url":"https://api.github.com/users/jprichardson/repos","events_url":"https://api.github.com/users/jprichardson/events{/privacy}","received_events_url":"https://api.github.com/users/jprichardson/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T18:24:53Z","updated_at":"2016-11-07T18:24:53Z","body":"> Is there a specific benchmarking package I should use? Some more specifics on input/output would be good.\r\n\r\nGood question. I have a lot of respect for this dev, so you could look at this: https://github.com/indutny/elliptic/tree/master/benchmarks\r\n\r\nI really just want you to quantify your original statement:\r\n\r\n> Because there could be an argument for greater speed in not using it.\r\n\r\n"}}
{"actor":{"display_login":"jprichardson"}}