{"action":"created","issue":{"url":"https://api.github.com/repos/doloopwhile/PyExecJS/issues/48","repository_url":"https://api.github.com/repos/doloopwhile/PyExecJS","labels_url":"https://api.github.com/repos/doloopwhile/PyExecJS/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/doloopwhile/PyExecJS/issues/48/comments","events_url":"https://api.github.com/repos/doloopwhile/PyExecJS/issues/48/events","html_url":"https://github.com/doloopwhile/PyExecJS/pull/48","id":149280056,"number":48,"title":"calling javascript executable using stdin/pipes instead of temp directory","user":{"login":"JonathanRaiman","id":1411079,"avatar_url":"https://avatars.githubusercontent.com/u/1411079?v=3","gravatar_id":"","url":"https://api.github.com/users/JonathanRaiman","html_url":"https://github.com/JonathanRaiman","followers_url":"https://api.github.com/users/JonathanRaiman/followers","following_url":"https://api.github.com/users/JonathanRaiman/following{/other_user}","gists_url":"https://api.github.com/users/JonathanRaiman/gists{/gist_id}","starred_url":"https://api.github.com/users/JonathanRaiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonathanRaiman/subscriptions","organizations_url":"https://api.github.com/users/JonathanRaiman/orgs","repos_url":"https://api.github.com/users/JonathanRaiman/repos","events_url":"https://api.github.com/users/JonathanRaiman/events{/privacy}","received_events_url":"https://api.github.com/users/JonathanRaiman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-18T21:40:22Z","updated_at":"2016-05-24T10:03:42Z","closed_at":"2016-05-24T10:03:42Z","pull_request":{"url":"https://api.github.com/repos/doloopwhile/PyExecJS/pulls/48","html_url":"https://github.com/doloopwhile/PyExecJS/pull/48","diff_url":"https://github.com/doloopwhile/PyExecJS/pull/48.diff","patch_url":"https://github.com/doloopwhile/PyExecJS/pull/48.patch"},"body":"The node binary executable performs `require(x)` commands using relative directory resolution. The previous temporary file approach would confuse this path resolution, thus making the `require('react')` call fail ('module not found').\r\nHere we change the `_execfile` method to instead take source code and pipe it to the javascript binary in question. This approach allows the `cwd` argument to be respected.\r\n\r\nCode snippet that used to fail, and now works (provided that you run this code from a directory where `npm install react` was run prior):\r\n\r\n```python\r\nimport execjs\r\ndefault = execjs.get(\"Node\")\r\ndefault = default.compile(\"\"\"\r\nvar React = require('react')\r\n\"\"\", cwd=\"./web\")\r\ndefault.eval(\"React.createElement('div', {className:'text-muted'}, '')\")\r\n```"},"comment":{"url":"https://api.github.com/repos/doloopwhile/PyExecJS/issues/comments/221223564","html_url":"https://github.com/doloopwhile/PyExecJS/pull/48#issuecomment-221223564","issue_url":"https://api.github.com/repos/doloopwhile/PyExecJS/issues/48","id":221223564,"user":{"login":"doloopwhile","id":1269088,"avatar_url":"https://avatars.githubusercontent.com/u/1269088?v=3","gravatar_id":"","url":"https://api.github.com/users/doloopwhile","html_url":"https://github.com/doloopwhile","followers_url":"https://api.github.com/users/doloopwhile/followers","following_url":"https://api.github.com/users/doloopwhile/following{/other_user}","gists_url":"https://api.github.com/users/doloopwhile/gists{/gist_id}","starred_url":"https://api.github.com/users/doloopwhile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doloopwhile/subscriptions","organizations_url":"https://api.github.com/users/doloopwhile/orgs","repos_url":"https://api.github.com/users/doloopwhile/repos","events_url":"https://api.github.com/users/doloopwhile/events{/privacy}","received_events_url":"https://api.github.com/users/doloopwhile/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T10:03:42Z","updated_at":"2016-05-24T10:03:42Z","body":"I implemented \"temp directory free\" execution in another pull request.\r\n\r\nThanks you."}}
{"actor":{"display_login":"doloopwhile"}}