{"_id":"gulp-flatmap","_rev":"6-93d9f33e8dc1a602e89c0bca9c5bfaa6","name":"gulp-flatmap","description":"map each file in a stream into multiple files that are piped out","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"gulp-flatmap","version":"1.0.0","description":"map each file in a stream into multiple files that are piped out","license":"MIT","repository":{"type":"git","url":"git+https://github.com/mariusgundersen/gulp-flatmap.git"},"author":{"name":"Marius Gundersen","email":"me@mariusgundersen.net","url":"https://github.com/mariusGundersen"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["gulpplugin","flatmap","split","fork","divide","separate","map","gulp"],"dependencies":{"gulp-util":"~2.2.14","through2":"~0.6.3"},"devDependencies":{"mocha":"*"},"gitHead":"c6adf542ad8c01d5e77152e22d18b6fc3f549d7c","bugs":{"url":"https://github.com/mariusgundersen/gulp-flatmap/issues"},"homepage":"https://github.com/mariusgundersen/gulp-flatmap#readme","_id":"gulp-flatmap@1.0.0","_shasum":"e634e03cffb263aebacfdc22dd8ce2f3d76ffe97","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"mariusgundersen","email":"npm@mariusgundersen.net"},"maintainers":[{"name":"mariusgundersen","email":"npm@mariusgundersen.net"}],"dist":{"shasum":"e634e03cffb263aebacfdc22dd8ce2f3d76ffe97","tarball":"https://registry.npmjs.org/gulp-flatmap/-/gulp-flatmap-1.0.0.tgz","integrity":"sha512-+3Gwsi9zRVJlx8jdr+jgo4EJymyWSeXGcA49aGWJkN4LshU1fjiGcwc5u6PDq9peslIj6uHbqZHqHdhRMkJqpg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCWUb1fI5P27jG0R7z/ArFEgPZJY/N3ueXjxKu2x0rfQIhAO7gu0nIZF9hUuTx+SN+lE+tZ47gzaDaRx3CmgGwWRM7"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/gulp-flatmap-1.0.0.tgz_1462137183875_0.6467299850191921"}},"1.0.1":{"name":"gulp-flatmap","version":"1.0.1","description":"map each file in a stream into multiple files that are piped out","license":"MIT","repository":{"type":"git","url":"git+https://github.com/mariusGundersen/gulp-flatmap.git"},"author":{"name":"Marius Gundersen","email":"me@mariusgundersen.net","url":"https://github.com/mariusGundersen"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["gulpplugin","flatmap","split","fork","divide","separate","map","gulp"],"dependencies":{"plugin-error":"0.1.2","through2":"2.0.3"},"devDependencies":{"mocha":"*","vinyl":"2.1.0"},"gitHead":"4e555756f3356f7057834b83a5b7632d880ada6f","bugs":{"url":"https://github.com/mariusGundersen/gulp-flatmap/issues"},"homepage":"https://github.com/mariusGundersen/gulp-flatmap#readme","_id":"gulp-flatmap@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.1.2","_npmUser":{"name":"mariusgundersen","email":"npm@mariusgundersen.net"},"dist":{"integrity":"sha512-bacfStryWzhv1c1drtFg8fruZL+DelPc6zjmrF4U8vHxkWi/jYrvDHY0BrcDjYrwC/9nE7OHFY/c1aIDQFhx2Q==","shasum":"e22a755335c181bf91842b08601cfbeeca55c632","tarball":"https://registry.npmjs.org/gulp-flatmap/-/gulp-flatmap-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIESby7UZZo2s3s5eVJnYnekUUVnrEbEjCYC8SkFTfAvyAiEAslOP+Rn64j8GrOE11rZAwcTJ8155Hcm+/DaWAjn2iwA="}]},"maintainers":[{"name":"mariusgundersen","email":"npm@mariusgundersen.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-flatmap-1.0.1.tgz_1515577431746_0.16605423996225"}},"1.0.2":{"name":"gulp-flatmap","version":"1.0.2","description":"map each file in a stream into multiple files that are piped out","license":"MIT","repository":{"type":"git","url":"git+https://github.com/mariusGundersen/gulp-flatmap.git"},"author":{"name":"Marius Gundersen","email":"me@mariusgundersen.net","url":"https://github.com/mariusGundersen"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["gulpplugin","flatmap","split","fork","divide","separate","map","gulp"],"dependencies":{"plugin-error":"0.1.2","through2":"2.0.3"},"devDependencies":{"mocha":"*","vinyl":"2.1.0"},"gitHead":"977a447ba8cffa25eee55a3ac51e9177e866218a","bugs":{"url":"https://github.com/mariusGundersen/gulp-flatmap/issues"},"homepage":"https://github.com/mariusGundersen/gulp-flatmap#readme","_id":"gulp-flatmap@1.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.1.2","_npmUser":{"name":"mariusgundersen","email":"npm@mariusgundersen.net"},"dist":{"integrity":"sha512-xm+Ax2vPL/xiMBqLFI++wUyPtncm3b55ztGHewmRcoG/sYb0OUTatjSacOud3fee77rnk+jOgnDEHhwBtMHgFA==","shasum":"b515ae6081d66af99daf56c612e2d92502720133","tarball":"https://registry.npmjs.org/gulp-flatmap/-/gulp-flatmap-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk8N5pXpJF+uRiNQ9yJwo8pAPZ5JdTvAS16ugCr55mZAIgCP5D3c5mOzbqICDL1tyvHqG8BHbDaVpY7S2TUKQx4ok="}]},"maintainers":[{"name":"mariusgundersen","email":"npm@mariusgundersen.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-flatmap-1.0.2.tgz_1515577630457_0.830919403815642"}}},"readme":"# [gulp](http://gulpjs.com)-flatmap\r\n\r\n> map each file in a stream into multiple files that are piped out\r\n\r\n## Install\r\n\r\n```bash\r\n$ npm install --save-dev gulp-flatmap\r\n```\r\n\r\n\r\n## Usage\r\n\r\n```js\r\nvar gulp = require('gulp');\r\nvar flatmap = require('gulp-flatmap');\r\nvar uglify = require('gulp-uglify');\r\nvar path = require('path');\r\nvar concat = require('gulp-concat');\r\n\r\ngulp.task('default', function () {\r\n  return gulp.src('*.json')\r\n    .pipe(flatmap(function(stream, file){\r\n      var contents = JSON.parse(file.contents.toString('utf8'));\r\n      //contents.files is an array\r\n      return gulp.src(contents.files)\r\n        //uglify each file individually\r\n        .pipe(uglify())\r\n        //combine the files\r\n        .pipe(concat(path.basename(file.path)));\r\n    }))\r\n    .pipe(gulp.dest('dist'));\r\n});\r\n```\r\n\r\n\r\n## API\r\n\r\nThe flatmap method takes one argument, a function. This function is called once for each file piped to `flatmap` and is passed a stream as its first argument and the [vinyl file](https://github.com/wearefractal/vinyl) as its second argument. The stream contains only one file.\r\n\r\nYou can now pipe this stream through as many steps as you want, before returning it from the function. All the streams returned from `flatmap` will be combined and their contents will be emited by `flatmap`.\r\n\r\n## License\r\n\r\nMIT © [Marius Gundersen](https://github.com/mariusGundersen)\r\n","maintainers":[{"name":"mariusgundersen","email":"npm@mariusgundersen.net"}],"time":{"modified":"2022-06-18T17:05:57.523Z","created":"2016-05-01T21:13:06.281Z","1.0.0":"2016-05-01T21:13:06.281Z","1.0.1":"2018-01-10T09:43:51.894Z","1.0.2":"2018-01-10T09:47:10.650Z"},"homepage":"https://github.com/mariusGundersen/gulp-flatmap#readme","keywords":["gulpplugin","flatmap","split","fork","divide","separate","map","gulp"],"repository":{"type":"git","url":"git+https://github.com/mariusGundersen/gulp-flatmap.git"},"author":{"name":"Marius Gundersen","email":"me@mariusgundersen.net","url":"https://github.com/mariusGundersen"},"bugs":{"url":"https://github.com/mariusGundersen/gulp-flatmap/issues"},"license":"MIT","readmeFilename":"readme.md"}