{"action":"created","issue":{"url":"https://api.github.com/repos/rvagg/through2/issues/34","labels_url":"https://api.github.com/repos/rvagg/through2/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/rvagg/through2/issues/34/comments","events_url":"https://api.github.com/repos/rvagg/through2/issues/34/events","html_url":"https://github.com/rvagg/through2/issues/34","id":50484948,"number":34,"title":"How I can create stream?","user":{"login":"tamtakoe","id":2244675,"avatar_url":"https://avatars.githubusercontent.com/u/2244675?v=3","gravatar_id":"","url":"https://api.github.com/users/tamtakoe","html_url":"https://github.com/tamtakoe","followers_url":"https://api.github.com/users/tamtakoe/followers","following_url":"https://api.github.com/users/tamtakoe/following{/other_user}","gists_url":"https://api.github.com/users/tamtakoe/gists{/gist_id}","starred_url":"https://api.github.com/users/tamtakoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamtakoe/subscriptions","organizations_url":"https://api.github.com/users/tamtakoe/orgs","repos_url":"https://api.github.com/users/tamtakoe/repos","events_url":"https://api.github.com/users/tamtakoe/events{/privacy}","received_events_url":"https://api.github.com/users/tamtakoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":32,"created_at":"2014-12-01T03:43:47Z","updated_at":"2015-02-08T17:48:23Z","closed_at":null,"body":"I try\r\n<pre>through2.obj(function(file, encoding, callback) {\r\n    this.emit('data', '...');\r\n    this.emit('end');\r\n\r\n   callback()\r\n})</pre>\r\n\r\nbut it is not work with pipes"},"comment":{"url":"https://api.github.com/repos/rvagg/through2/issues/comments/73422022","html_url":"https://github.com/rvagg/through2/issues/34#issuecomment-73422022","issue_url":"https://api.github.com/repos/rvagg/through2/issues/34","id":73422022,"user":{"login":"tamtakoe","id":2244675,"avatar_url":"https://avatars.githubusercontent.com/u/2244675?v=3","gravatar_id":"","url":"https://api.github.com/users/tamtakoe","html_url":"https://github.com/tamtakoe","followers_url":"https://api.github.com/users/tamtakoe/followers","following_url":"https://api.github.com/users/tamtakoe/following{/other_user}","gists_url":"https://api.github.com/users/tamtakoe/gists{/gist_id}","starred_url":"https://api.github.com/users/tamtakoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamtakoe/subscriptions","organizations_url":"https://api.github.com/users/tamtakoe/orgs","repos_url":"https://api.github.com/users/tamtakoe/repos","events_url":"https://api.github.com/users/tamtakoe/events{/privacy}","received_events_url":"https://api.github.com/users/tamtakoe/received_events","type":"User","site_admin":false},"created_at":"2015-02-08T17:48:23Z","updated_at":"2015-02-08T17:48:23Z","body":"I thought about this method, but came up with a other way, it will not have make logic out of the stream.\r\n\r\n```js\r\n//storage.js\r\nvar data = {};\r\n\r\nmodule.export = function(key, value){\r\n    return throught.obj(function(file, enc, callback) {\r\n        if (value) {\r\n            data[key] = value;\r\n        } else {\r\n            file.contents = new Buffer(data[key]);\r\n        }\r\n        callback(null, file)\r\n    })\r\n}\r\n```\r\n```js\r\n//gulpfile.js\r\nvar storage = require('storage')\r\n\r\nstream\r\n    .pipe(storage('foo','bar'))\r\n    .pipe(storage('foo'))\r\n```"}}