{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/79","labels_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/79/comments","events_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/79/events","html_url":"https://github.com/ipfs/node-ipfs-api/issues/79","id":112126817,"number":79,"title":"ipfs.add should always return same type","user":{"login":"VictorBjelkholm","id":459764,"avatar_url":"https://avatars.githubusercontent.com/u/459764?v=3","gravatar_id":"","url":"https://api.github.com/users/VictorBjelkholm","html_url":"https://github.com/VictorBjelkholm","followers_url":"https://api.github.com/users/VictorBjelkholm/followers","following_url":"https://api.github.com/users/VictorBjelkholm/following{/other_user}","gists_url":"https://api.github.com/users/VictorBjelkholm/gists{/gist_id}","starred_url":"https://api.github.com/users/VictorBjelkholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VictorBjelkholm/subscriptions","organizations_url":"https://api.github.com/users/VictorBjelkholm/orgs","repos_url":"https://api.github.com/users/VictorBjelkholm/repos","events_url":"https://api.github.com/users/VictorBjelkholm/events{/privacy}","received_events_url":"https://api.github.com/users/VictorBjelkholm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-19T11:37:00Z","updated_at":"2015-10-21T19:53:40Z","closed_at":null,"body":"`ipfs.add` have a kind of confused API (the same with some other methods), that it's sometimes returning a stream and sometimes an object. I think this is because of the environment but we should try to make sure that inside the callback, users don't have to try to figure out what type it is, it should always be the same type.\r\n\r\nWill also help simplifying the tests for browser/node environments."},"comment":{"url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/comments/150007236","html_url":"https://github.com/ipfs/node-ipfs-api/issues/79#issuecomment-150007236","issue_url":"https://api.github.com/repos/ipfs/node-ipfs-api/issues/79","id":150007236,"user":{"login":"VictorBjelkholm","id":459764,"avatar_url":"https://avatars.githubusercontent.com/u/459764?v=3","gravatar_id":"","url":"https://api.github.com/users/VictorBjelkholm","html_url":"https://github.com/VictorBjelkholm","followers_url":"https://api.github.com/users/VictorBjelkholm/followers","following_url":"https://api.github.com/users/VictorBjelkholm/following{/other_user}","gists_url":"https://api.github.com/users/VictorBjelkholm/gists{/gist_id}","starred_url":"https://api.github.com/users/VictorBjelkholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VictorBjelkholm/subscriptions","organizations_url":"https://api.github.com/users/VictorBjelkholm/orgs","repos_url":"https://api.github.com/users/VictorBjelkholm/repos","events_url":"https://api.github.com/users/VictorBjelkholm/events{/privacy}","received_events_url":"https://api.github.com/users/VictorBjelkholm/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T19:53:40Z","updated_at":"2015-10-21T19:53:40Z","body":"I see now that `ipfs.add` is not the only command that works this way. `ipfs.object.data`, `ipfs.cat` and `ipfs.block.get` would need to be fixed as well."}}