{"action":"opened","pull_request":{"created_at":"2011-11-26T20:17:31Z","review_comments":0,"state":"open","patch_url":"https://github.com/substack/node-browserify/pull/94.patch","changed_files":1,"_links":{"review_comments":{"href":"https://api.github.com/repos/substack/node-browserify/pulls/94/comments"},"comments":{"href":"https://api.github.com/repos/substack/node-browserify/issues/94/comments"},"html":{"href":"https://github.com/substack/node-browserify/pull/94"},"self":{"href":"https://api.github.com/repos/substack/node-browserify/pulls/94"}},"updated_at":"2011-11-26T20:17:31Z","comments":0,"user":{"gravatar_id":"3551c182dbeaa1ce1f91dc9583d4c6df","id":23288,"url":"https://api.github.com/users/znerol","login":"znerol","avatar_url":"https://secure.gravatar.com/avatar/3551c182dbeaa1ce1f91dc9583d4c6df?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"issue_url":"https://github.com/substack/node-browserify/issues/94","body":"Consider the following package structure:\r\n\r\n* package.json: <pre>{   \"name\":\"testpkg\",\r\n    \"main\":\"./index.js\",\r\n    \"browserify\":\"./browser.js\"\r\n}</pre>\r\n* index.js: <pre>exports.stuff = 'for node';</pre>\r\n* browser.js: <pre>exports.stuff = 'for browser';\r\nwindow.onload = function() {\r\n    alert('code loaded, it works!');\r\n}</pre>\r\n* entry.js: <pre>require('./subdir/require-super');</pre>\r\n* subdir/require-super.js: <pre>require('../');</pre>\r\n\r\nWhen running the browsified version of entry.js in a browser, the following error is thrown:\r\n\r\n<pre>\r\nUncaught Error: Cannot find module '../'\r\n</pre>\r\n\r\nThe loadAsDirectory function of the prelude script prepended to browserified modules strips off trailing slashes before concatenating the argument with '/package.js' and '/index'. If the argument is a single slash, i.e. a path pointing to the root directory, it should be preserved when passing to path.resolve subsequently.\r\n\r\nFix this problem by stripping off trailing slashes only for package/index lookup.\r\n\r\n","deletions":3,"merged":false,"mergeable":null,"commits":1,"number":94,"id":530774,"merged_by":null,"base":{"user":{"gravatar_id":"d4a2f12ceae3b7f211b661576d22bfb9","id":12631,"url":"https://api.github.com/users/substack","login":"substack","avatar_url":"https://secure.gravatar.com/avatar/d4a2f12ceae3b7f211b661576d22bfb9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"repo":{"created_at":"2010-09-22T16:11:32Z","pushed_at":"2011-11-26T02:42:43Z","clone_url":"https://github.com/substack/node-browserify.git","private":false,"updated_at":"2011-11-26T18:58:05Z","name":"node-browserify","master_branch":null,"watchers":539,"svn_url":"https://svn.github.com/substack/node-browserify","forks":43,"language":"JavaScript","owner":{"gravatar_id":"d4a2f12ceae3b7f211b661576d22bfb9","id":12631,"url":"https://api.github.com/users/substack","login":"substack","avatar_url":"https://secure.gravatar.com/avatar/d4a2f12ceae3b7f211b661576d22bfb9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":931039,"homepage":"","description":"Browser-side require() for your node modules and npm packages","git_url":"git://github.com/substack/node-browserify.git","html_url":"https://github.com/substack/node-browserify","ssh_url":"git@github.com:substack/node-browserify.git","size":556,"fork":false,"url":"https://api.github.com/repos/substack/node-browserify","open_issues":40},"sha":"050309cf3f6fe8a09b30009350d73da9c4221cac","ref":"master","label":"substack:master"},"additions":3,"head":{"user":{"gravatar_id":"3551c182dbeaa1ce1f91dc9583d4c6df","id":23288,"url":"https://api.github.com/users/znerol","login":"znerol","avatar_url":"https://secure.gravatar.com/avatar/3551c182dbeaa1ce1f91dc9583d4c6df?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"repo":{"created_at":"2011-11-26T18:11:32Z","pushed_at":"2011-11-26T19:10:31Z","clone_url":"https://github.com/znerol/node-browserify.git","private":false,"updated_at":"2011-11-26T19:10:31Z","name":"node-browserify","master_branch":null,"watchers":1,"svn_url":"https://svn.github.com/znerol/node-browserify","forks":0,"language":"JavaScript","owner":{"gravatar_id":"3551c182dbeaa1ce1f91dc9583d4c6df","id":23288,"url":"https://api.github.com/users/znerol","login":"znerol","avatar_url":"https://secure.gravatar.com/avatar/3551c182dbeaa1ce1f91dc9583d4c6df?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2856934,"homepage":"","description":"Browser-side require() for your node modules and npm packages","git_url":"git://github.com/znerol/node-browserify.git","html_url":"https://github.com/znerol/node-browserify","ssh_url":"git@github.com:znerol/node-browserify.git","size":140,"fork":true,"url":"https://api.github.com/repos/znerol/node-browserify","open_issues":0},"sha":"94b01e292e3cffc6230d076b3c818ff18dbe8f86","ref":"bug/master/relative-load-toplevel-directory","label":"znerol:bug/master/relative-load-toplevel-directory"},"title":"Fix loading toplevel directory from subdir in prelude","closed_at":null,"html_url":"https://github.com/substack/node-browserify/pull/94","url":"https://api.github.com/repos/substack/node-browserify/pulls/94","diff_url":"https://github.com/substack/node-browserify/pull/94.diff","merged_at":null},"number":94}