{"action":"created","issue":{"url":"https://api.github.com/repos/chevett/absolurl/issues/5","labels_url":"https://api.github.com/repos/chevett/absolurl/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/chevett/absolurl/issues/5/comments","events_url":"https://api.github.com/repos/chevett/absolurl/issues/5/events","html_url":"https://github.com/chevett/absolurl/issues/5","id":55073928,"number":5,"title":"Remove `util` and `EventEmitter`","user":{"login":"twolfson","id":902488,"avatar_url":"https://avatars.githubusercontent.com/u/902488?v=3","gravatar_id":"","url":"https://api.github.com/users/twolfson","html_url":"https://github.com/twolfson","followers_url":"https://api.github.com/users/twolfson/followers","following_url":"https://api.github.com/users/twolfson/following{/other_user}","gists_url":"https://api.github.com/users/twolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/twolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twolfson/subscriptions","organizations_url":"https://api.github.com/users/twolfson/orgs","repos_url":"https://api.github.com/users/twolfson/repos","events_url":"https://api.github.com/users/twolfson/events{/privacy}","received_events_url":"https://api.github.com/users/twolfson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-21T20:40:29Z","updated_at":"2015-01-22T03:19:55Z","closed_at":"2015-01-21T22:23:09Z","body":"I am very close to using this library. However, it is including a lot of unnecessary weight which is making it a bad idea for the browser (via `browserify`). The `util` (unused) and `EventEmitter` require add on 7kb gzipped.\r\n\r\n```bash\r\n# With `util/EventEmitter`\r\n$ ./node_modules/.bin/browserify index.js | gzip | wc --bytes\r\n21075\r\n\r\n# Without `util/EventEmitter`\r\n$ ./node_modules/.bin/browserify index.js | gzip | wc --bytes\r\n14472\r\n```\r\n\r\nThere is no need for `EventEmitter`. This is a synchronous function, not a stream. It should be throwing errors. If it were a stream, then there would be `data` and `end` events in addition to the `error` event."},"comment":{"url":"https://api.github.com/repos/chevett/absolurl/issues/comments/70965622","html_url":"https://github.com/chevett/absolurl/issues/5#issuecomment-70965622","issue_url":"https://api.github.com/repos/chevett/absolurl/issues/5","id":70965622,"user":{"login":"chevett","id":1141615,"avatar_url":"https://avatars.githubusercontent.com/u/1141615?v=3","gravatar_id":"","url":"https://api.github.com/users/chevett","html_url":"https://github.com/chevett","followers_url":"https://api.github.com/users/chevett/followers","following_url":"https://api.github.com/users/chevett/following{/other_user}","gists_url":"https://api.github.com/users/chevett/gists{/gist_id}","starred_url":"https://api.github.com/users/chevett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chevett/subscriptions","organizations_url":"https://api.github.com/users/chevett/orgs","repos_url":"https://api.github.com/users/chevett/repos","events_url":"https://api.github.com/users/chevett/events{/privacy}","received_events_url":"https://api.github.com/users/chevett/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T03:19:55Z","updated_at":"2015-01-22T03:19:55Z","body":"oh, i expect different results.  It appears that the results you're expecting are exactly what you'd get from the resolve method of the url module.  \r\n\r\n`absolurl` is different from `url.resolve` because it has knowledge of tld names and such.  For example, it knows that file.txt isn't a valid domain, so it always resolves it as a relative url instead of http://file.txt.  `absolurl` is of limited benefit, but it is necessary for a silly project that I'm working on.  \r\n\r\nYour resolution of `resolveLink('news', 'http://google.com/news/')` is wrong no matter what a resolver knows.  It should be `http://google.com/news/news`.\r\n\r\nAnyway, it seems that `url` or `resolve-url` should do what you're looking for.\r\n\r\n```js\r\n> console.dir(resolveLink('news', 'http://google.com/news/'));\r\n'http://google.com/news' //this should be 'http://google.com/news/news'\r\n> console.dir(resolveLink('news', 'http://google.com/news')); // removed trailing slash\r\n//should be 'http://google.com/news'\r\n> console.dir(resolveLink('default.aspx', 'http://google.com/news/'));\r\n'http://default.aspx/' //should be 'http://google.com/news/default.aspx'\r\n> console.dir(resolveLink('/wtf', 'http://google.com/news/'));\r\n'http://google.com/wtf' // correct\r\n> console.dir(resolveLink('file.txt', 'http://google.com/'));\r\n'http://file.txt/' //should be 'http://google.com/file.txt'\r\n> console.dir(resolveLink('sky.net', 'http://google.com/'));\r\n'http://sky.net/' // correct\r\n```"}}