{"action":"closed","issue":{"url":"https://api.github.com/repos/iojs/readable-stream/issues/102","labels_url":"https://api.github.com/repos/iojs/readable-stream/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/iojs/readable-stream/issues/102/comments","events_url":"https://api.github.com/repos/iojs/readable-stream/issues/102/events","html_url":"https://github.com/iojs/readable-stream/issues/102","id":55419089,"number":102,"title":"Simpler stream creation","user":{"login":"sonewman","id":2377664,"avatar_url":"https://avatars.githubusercontent.com/u/2377664?v=3","gravatar_id":"","url":"https://api.github.com/users/sonewman","html_url":"https://github.com/sonewman","followers_url":"https://api.github.com/users/sonewman/followers","following_url":"https://api.github.com/users/sonewman/following{/other_user}","gists_url":"https://api.github.com/users/sonewman/gists{/gist_id}","starred_url":"https://api.github.com/users/sonewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonewman/subscriptions","organizations_url":"https://api.github.com/users/sonewman/orgs","repos_url":"https://api.github.com/users/sonewman/repos","events_url":"https://api.github.com/users/sonewman/events{/privacy}","received_events_url":"https://api.github.com/users/sonewman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iojs/readable-stream/labels/wg-agenda","name":"wg-agenda","color":"448844"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2015-01-25T15:30:32Z","updated_at":"2015-03-03T18:45:55Z","closed_at":"2015-03-03T18:45:55Z","body":"I have mentioned this in a couple of other threads before, I just wanted to get some thoughts and opinions really.\r\n\r\nMy suggestion is that we allow the `_` methods, which need to be set on a stream, be passed in as part of the options on instantiation. e.g.\r\n```javascript\r\nvar stream = require('readable-stream')\r\n\r\nvar readable = new stream.Readable({\r\n  read(n) { }\r\n})\r\n\r\nvar writable = new stream.Writable({\r\n  write(data, enc, next) { },\r\n  // edit - courtesy @calvinmetcalf\r\n  writev(chunks, next) { }\r\n})\r\n\r\nvar duplex = new stream.Duplex({\r\n  read(n) { },\r\n  write(data, enc, next) { },\r\n  // edit - courtesy @calvinmetcalf\r\n  writev(chunks, next) { }\r\n})\r\n\r\nvar transform = new stream.Transform({\r\n  transform(data, enc, next) { },\r\n  // edit - courtesy @calvinmetcalf\r\n  flush(done) { }\r\n})\r\n```\r\n  **edit - functions in ES6 for readability**\r\n\r\nWhat do you think?"}}