{"action":"created","issue":{"url":"https://api.github.com/repos/paulcpederson/focusin/issues/1","labels_url":"https://api.github.com/repos/paulcpederson/focusin/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/paulcpederson/focusin/issues/1/comments","events_url":"https://api.github.com/repos/paulcpederson/focusin/issues/1/events","html_url":"https://github.com/paulcpederson/focusin/issues/1","id":115935223,"number":1,"title":"expose polyfill as function","user":{"login":"thejameskyle","id":952783,"avatar_url":"https://avatars.githubusercontent.com/u/952783?v=3","gravatar_id":"","url":"https://api.github.com/users/thejameskyle","html_url":"https://github.com/thejameskyle","followers_url":"https://api.github.com/users/thejameskyle/followers","following_url":"https://api.github.com/users/thejameskyle/following{/other_user}","gists_url":"https://api.github.com/users/thejameskyle/gists{/gist_id}","starred_url":"https://api.github.com/users/thejameskyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejameskyle/subscriptions","organizations_url":"https://api.github.com/users/thejameskyle/orgs","repos_url":"https://api.github.com/users/thejameskyle/repos","events_url":"https://api.github.com/users/thejameskyle/events{/privacy}","received_events_url":"https://api.github.com/users/thejameskyle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-09T18:22:03Z","updated_at":"2015-11-09T19:39:41Z","closed_at":null,"body":"I'm currently trying to use this polyfill for a package of mine that needs to be able to run in both the browser and in node.js. I was wondering if you'd be willing to change the interface of this package so that it is wrapped in a function somehow:\r\n\r\n```js\r\nrequire('focusin');\r\nrequire('focusin').polyfill();\r\n```\r\n\r\nThis way I could lazily polyfill it when it is necessary. [Other polyfills](https://github.com/jakearchibald/es6-promise#auto-polyfill) do this as well.\r\n\r\nRelated to: https://github.com/thejameskyle/react-modal2/issues/2\r\n"},"comment":{"url":"https://api.github.com/repos/paulcpederson/focusin/issues/comments/155168615","html_url":"https://github.com/paulcpederson/focusin/issues/1#issuecomment-155168615","issue_url":"https://api.github.com/repos/paulcpederson/focusin/issues/1","id":155168615,"user":{"login":"paulcpederson","id":1031758,"avatar_url":"https://avatars.githubusercontent.com/u/1031758?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcpederson","html_url":"https://github.com/paulcpederson","followers_url":"https://api.github.com/users/paulcpederson/followers","following_url":"https://api.github.com/users/paulcpederson/following{/other_user}","gists_url":"https://api.github.com/users/paulcpederson/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcpederson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcpederson/subscriptions","organizations_url":"https://api.github.com/users/paulcpederson/orgs","repos_url":"https://api.github.com/users/paulcpederson/repos","events_url":"https://api.github.com/users/paulcpederson/events{/privacy}","received_events_url":"https://api.github.com/users/paulcpederson/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T19:39:41Z","updated_at":"2015-11-09T19:39:41Z","body":"ha, beat me to it! We did this almost identically. The only difference is that I created a new file which automatically calls the polyfill for the minified version. That way people can still just load a js script in the client if they need to. \r\n\r\nTake a look at #3 and see if that would work!"}}