{"action":"created","issue":{"url":"https://api.github.com/repos/gulpjs/gulp/issues/243","labels_url":"https://api.github.com/repos/gulpjs/gulp/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/gulpjs/gulp/issues/243/comments","events_url":"https://api.github.com/repos/gulpjs/gulp/issues/243/events","html_url":"https://github.com/gulpjs/gulp/issues/243","id":27028643,"number":243,"title":"Outputting multiple files","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":31,"created_at":"2014-02-06T06:02:20Z","updated_at":"2015-02-05T18:16:50Z","closed_at":"2014-02-06T07:26:21Z","body":"I am interested in creating a gulp plugin for spritesmith, an images to spritesheet/CSS variables library. From a glance, it looks like `gulp` does not have any documentation on streams that output different data formats.\r\n\r\nTo elaborate further, the grunt flavor outputs a generated image and a set of formatted CSS. I was wondering if there is a defacto/preferred way to handle this case.\r\n\r\nI have been playing around with my options and have found a nice syntax\r\n\r\n```js\r\n// Create muxed stream\r\nvar spriteData = gulp.src(path.images).pipe(gulpSpritesmith({\r\n  cssFormat: 'css'\r\n}));\r\n\r\n\r\n// Output the image and CSS\r\n// Under the hood, this would perform a demux + pipe\r\nspriteData.pipe('image', gulp.dest('output.png'));\r\nspriteData.pipe('css', gulp.dest('output.css'));\r\n```\r\n\r\nAlternatively, I can use a library like `mux-demux` or output a JSON stream which the end user would have to listen to keys on. I dislike those options since they require more knowledge on the end-user's part.\r\n\r\nReference links:\r\n\r\nhttps://github.com/Ensighten/spritesmith\r\n\r\n// Open issue to create gulp plugin\r\nhttps://github.com/Ensighten/spritesmith/issues/32\r\n\r\nhttps://github.com/dominictarr/mux-demux\r\n\r\nhttps://github.com/Ensighten/grunt-spritesmith"},"comment":{"url":"https://api.github.com/repos/gulpjs/gulp/issues/comments/73097149","html_url":"https://github.com/gulpjs/gulp/issues/243#issuecomment-73097149","issue_url":"https://api.github.com/repos/gulpjs/gulp/issues/243","id":73097149,"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},"created_at":"2015-02-05T18:16:50Z","updated_at":"2015-02-05T18:16:50Z","body":"Fwiw, `gulp.spritesmith` now supports outputting as both a single stream and multiple streams:\r\n\r\nhttps://github.com/twolfson/gulp.spritesmith/tree/2.5.0#getting-started"}}