{"id":15361574,"url":"https://github.com/popomore/gulp-mirror","last_synced_at":"2025-09-10T15:34:57.280Z","repository":{"id":57258270,"uuid":"21471393","full_name":"popomore/gulp-mirror","owner":"popomore","description":"Make a mirror of stream","archived":false,"fork":false,"pushed_at":"2016-02-01T04:44:35.000Z","size":13,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T09:14:46.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/popomore.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-03T17:38:51.000Z","updated_at":"2021-11-08T11:03:36.000Z","dependencies_parsed_at":"2022-08-25T21:23:41.348Z","dependency_job_id":null,"html_url":"https://github.com/popomore/gulp-mirror","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popomore%2Fgulp-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popomore%2Fgulp-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popomore%2Fgulp-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popomore%2Fgulp-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/popomore","download_url":"https://codeload.github.com/popomore/gulp-mirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249040143,"owners_count":21202826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T12:55:40.266Z","updated_at":"2025-04-15T09:15:00.954Z","avatar_url":"https://github.com/popomore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-mirror\n\nMake a mirror of stream, it's useful that do different transform of the same stream.\n\n---\n\n[![NPM version](https://img.shields.io/npm/v/gulp-mirror.svg?style=flat)](https://npmjs.org/package/gulp-mirror)\n[![Build Status](https://img.shields.io/travis/popomore/gulp-mirror.svg?style=flat)](https://travis-ci.org/popomore/gulp-mirror)\n[![Build Status](https://img.shields.io/coveralls/popomore/gulp-mirror.svg?style=flat)](https://coveralls.io/r/popomore/gulp-mirror)\n[![NPM downloads](http://img.shields.io/npm/dm/gulp-mirror.svg?style=flat)](https://npmjs.org/package/gulp-mirror)\n\n## Install\n\n```\n$ npm install gulp-mirror\n```\n\n## Usage\n\nReal world [example](https://github.com/popomore/gulp-mirror/tree/master/examples).\n\n```\nvar gulp = require('gulp');\nvar concat = require('gulp-concat');\nvar mirror = require('gulp-mirror');\nvar rename = require('gulp-rename');\n\ngulp.task('default', function() {\n  return gulp.src('src/**/*.js')\n  .pipe(concat('all.js'))\n  .pipe(mirror(\n    rename('browser.js'),\n    rename('common.js'),\n    rename('node.js')\n  ))\n  .pipe(gulp.dest('dist'));\n});\n```\n\nConcat all js files in src directory, then rename it using mirror that will create three files which are the same.\n\n## API\n\n### mirror(stream1, stream2 ..., streamN)\n\nPass the input stream to all the mirrored stream with cloned `File` object. The mirrored stream also can be pipeline stream using [multipipe](https://github.com/juliangruber/multipipe), see [example 2](https://github.com/popomore/gulp-mirror/tree/master/examples#example-2).\n\n```\ngulp.src(source)\n.pipe(sharedStream1)\n.pipe(mirror(\n  stream1,\n  stream2,\n  ...\n  streamN\n))\n.pipe(sharedStream2)\n.pipe(gulp.dest(dest));\n```\n\nStream flow\n\n```\n                        --\u003e  stream1 --\u003e \n                      /                   \\\nsrc --\u003e sharedStream1    --\u003e  stream2 --\u003e \n                      \\                     \\ \n                          --\u003e    ...   --\u003e     sharedStream2 --\u003e dest\n                        \\                    /  \n                           --\u003e  streamN  --\u003e \n```\n\n**if mirror has only one argument, it will create another passthrough stream, just like [gulp-clone](https://github.com/mariocasciaro/gulp-clone)**, See [example 3](https://github.com/popomore/gulp-mirror/tree/master/examples#example-3).\n\n### mirror([stream1, stream2 ..., streamN])\n\nSometimes the number of streams is variable, then we can pass to `mirror` an array of streams as unique argument.\n\n## LICENSE\n\nCopyright (c) 2015 popomore. Licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpopomore%2Fgulp-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpopomore%2Fgulp-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpopomore%2Fgulp-mirror/lists"}