{"_id":"vinyl-map","_rev":"26-308e92fead5c07c8fae57dea0ae8ef9b","name":"vinyl-map","description":"Map vinyl files' contents as strings, so you can easily use existing code without needing yet another gulp plugin!","dist-tags":{"latest":"1.0.2"},"versions":{"0.0.0":{"name":"vinyl-map","description":"Map vinyl files' contents as strings, so you can easily use existing code without needing yet another gulp plugin!","version":"0.0.0","main":"index.js","dependencies":{"through":"~2.3.4","concat-stream":"~1.4.1","new-from":"0.0.3"},"devDependencies":{"tape":"~2.3.2","vinyl":"~0.2.1"},"scripts":{"test":"node test"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/vinyl-map"},"bugs":{"url":"https://github.com/hughsk/vinyl-map/issues"},"homepage":"https://github.com/hughsk/vinyl-map","keywords":["vinyl","gulp","gulpfriendly","file","stream","map"],"_id":"vinyl-map@0.0.0","dist":{"shasum":"88ea91ad24b011df7d76fd1ddcb29ab3b92722d1","tarball":"https://registry.npmjs.org/vinyl-map/-/vinyl-map-0.0.0.tgz","integrity":"sha512-PCstSSRxjYt/6VjNxS2qBQ3lX2mAMcDY1NNJxOVL1pdgtUBrRgA1PlrD/g96GNVjLEHM3pHWAV2roF+vAANViw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB8dCwlYN87CNfI6YCJBW2CJBSN/EPWT5NCO/AA+0d4jAiAVkCwbvVL/Vg/fGx7Rnn0FtTlXU0duAApnrzbycwb4GA=="}]},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"deprecated":"Missing dependencies resolved in v1.0.2 (Run 'npm update --save vinyl-map' to update package.json)"},"0.0.1":{"name":"vinyl-map","description":"Map vinyl files' contents as strings, so you can easily use existing code without needing yet another gulp plugin!","version":"0.0.1","main":"index.js","dependencies":{"through":"~2.3.4","concat-stream":"~1.4.1","new-from":"0.0.3"},"devDependencies":{"tape":"~2.3.2","vinyl":"~0.2.1"},"scripts":{"test":"node test"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/vinyl-map"},"bugs":{"url":"https://github.com/hughsk/vinyl-map/issues"},"homepage":"https://github.com/hughsk/vinyl-map","keywords":["vinyl","gulp","gulpfriendly","file","stream","map"],"_id":"vinyl-map@0.0.1","dist":{"shasum":"47652ba5c5f3dd36db146223e7a0d2492970a8c3","tarball":"https://registry.npmjs.org/vinyl-map/-/vinyl-map-0.0.1.tgz","integrity":"sha512-MytfE3+1EVINxj/q1Ik5Nu/eIbvbwqRWIh96qVF55EWUjRJy+hFGqwl91EFB2FNT+tg3dQGMijewL44gg3Sa+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoe3nPuZ3/lBEXpW8LumYVrv2Z6FGttrq+RI9WDKkwnAIgS7k0OgIGrrtBNE3uFj+WnAXSEsyqI475soRAk9ZFazo="}]},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"deprecated":"Missing dependencies resolved in v1.0.2 (Run 'npm update --save vinyl-map' to update package.json)"},"0.1.0":{"name":"vinyl-map","description":"Map vinyl files' contents as strings, so you can easily use existing code without needing yet another gulp plugin!","version":"0.1.0","main":"index.js","dependencies":{"through":"~2.3.4","concat-stream":"~1.4.1","new-from":"0.0.3"},"devDependencies":{"tape":"~2.3.2","vinyl":"~0.2.1"},"scripts":{"test":"node test"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/vinyl-map"},"bugs":{"url":"https://github.com/hughsk/vinyl-map/issues"},"homepage":"https://github.com/hughsk/vinyl-map","keywords":["vinyl","gulp","gulpfriendly","file","stream","map"],"_id":"vinyl-map@0.1.0","dist":{"shasum":"4698c7391ea9c94c5779d6d2ba16aa890f4ab8e3","tarball":"https://registry.npmjs.org/vinyl-map/-/vinyl-map-0.1.0.tgz","integrity":"sha512-eeFW0q2rwuDZ7qFcf+S4OT9DISfjaWoJiLrJxKpNBiXGREBO5lj+A6COKnqm91+IwMY38A4vDWnh0qtxyU5duA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB8h81sVRdRSN6EGLCDrVfRf05k0f8tBu1h0XIo/3fZvAiBWLCW1UTGZ/934ofKo+IjwK9VoOtHZ3920Ytzc9PVlMw=="}]},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"directories":{},"deprecated":"Missing dependencies resolved in v1.0.2 (Run 'npm update --save vinyl-map' to update package.json)"},"1.0.0":{"name":"vinyl-map","description":"Map vinyl files' contents as strings, so you can easily use existing code without needing yet another gulp plugin!","version":"1.0.0","main":"index.js","dependencies":{"through2":"^0.4.1","bl":"^0.7.0","new-from":"0.0.3"},"devDependencies":{"tape":"~2.3.2","vinyl":"~0.2.1"},"scripts":{"test":"node test"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/vinyl-map"},"bugs":{"url":"https://github.com/hughsk/vinyl-map/issues"},"homepage":"https://github.com/hughsk/vinyl-map","keywords":["vinyl","gulp","gulpfriendly","file","stream","map"],"_id":"vinyl-map@1.0.0","dist":{"shasum":"a0cca100f074f263b4181d170783a23b3685e845","tarball":"https://registry.npmjs.org/vinyl-map/-/vinyl-map-1.0.0.tgz","integrity":"sha512-2HVLRPLnOS/PtJ6ASpzHbwjnHs/vPlQU5tqqGdDWjwAiTLMhvr7IhXcnemDSi/9bRveasdfjle6Vm1Ea1j4amA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBlB9M6chmbc3VdEoeQQejOKpUwTudW7u4E6kmqagvo/AiEA+0YVb32T7uxtLs8VaDEcpaJ7Bu/Bu9MxR0rmrTBft5A="}]},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"deprecated":"Missing dependencies resolved in v1.0.2 (Run 'npm update --save vinyl-map' to update package.json)"},"1.0.1":{"name":"vinyl-map","description":"Map vinyl files' contents as strings, so you can easily use existing code without needing yet another gulp plugin!","version":"1.0.1","main":"index.js","dependencies":{"through2":"^0.4.1","bl":"^0.7.0","new-from":"0.0.3"},"devDependencies":{"tape":"~2.3.2","vinyl":"~0.2.1","uglify-js":"~2.4.12","gulp":"~3.5.2"},"scripts":{"test":"node test"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"license":"MIT","repository":{"type":"git","url":"git://github.com/hughsk/vinyl-map"},"bugs":{"url":"https://github.com/hughsk/vinyl-map/issues"},"homepage":"https://github.com/hughsk/vinyl-map","keywords":["vinyl","gulp","gulpfriendly","file","stream","map"],"_id":"vinyl-map@1.0.1","dist":{"shasum":"ccf64572a7be1c0b40190cd797cf5c2079f5ca1d","tarball":"https://registry.npmjs.org/vinyl-map/-/vinyl-map-1.0.1.tgz","integrity":"sha512-yp931L1yz9kHKzMtW5+uUg6sLuOe8l4fMs17oVuFYg1ZGbjAHe46SscQ6DiPPPCIXF/p+zry0sP1wxzVWRLZsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDm6NDAYiYmFkupvjVyLlTuDE8uDv388dEVgkZnpfU5wIgDTJ8+98nxPN0WhLT1Rlx24sJmFTOnbcvjBT721b+UcE="}]},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"deprecated":"Missing dependencies resolved in v1.0.2 (Run 'npm update --save vinyl-map' to update package.json)"},"1.0.2":{"name":"vinyl-map","description":"Map vinyl files' contents as strings, so you can easily use existing code without needing yet another gulp plugin!","version":"1.0.2","main":"index.js","dependencies":{"through2":"^0.4.1","bl":"^1.1.2","new-from":"0.0.3"},"devDependencies":{"concat-stream":"~1.5.2","tape":"~2.3.2","vinyl":"~0.2.1","uglify-js":"~2.4.12","gulp":"~3.5.2"},"scripts":{"test":"node test"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"contributors":[{"name":"Andrew Odri","email":"andrew@affirmix.com","url":"https://affirmix.com/"}],"license":"MIT","repository":{"type":"git","url":"git://github.com/affirmix/vinyl-map.git"},"bugs":{"url":"https://github.com/affirmix/vinyl-map/issues"},"homepage":"https://github.com/affirmix/vinyl-map","keywords":["vinyl","gulp","gulpfriendly","file","stream","map"],"gitHead":"37be1bfb5c13441268357e568c951bd670951959","_id":"vinyl-map@1.0.2","_shasum":"a8b296025f973fa7cad62817967a48f1d176bf7c","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"affirmix","email":"andrew@affirmix.com"},"dist":{"shasum":"a8b296025f973fa7cad62817967a48f1d176bf7c","tarball":"https://registry.npmjs.org/vinyl-map/-/vinyl-map-1.0.2.tgz","integrity":"sha512-I8d+giAiiyHfuMbMyuduqA9aZj9JmbOTp4BMDQgbtMGpUFbdzxw/lp01nv0fldqU8gTZQccqp2MIpAsKz810+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCICt1b0jCoExqiz6D/lMR3uElVHyU0xx6jNqBw/mEabJqAh8TrEgAy7MV8w57J+jDV3zrHkDKrOQWZD6YAeIHtrjq"}]},"maintainers":[{"name":"affirmix","email":"andrew@affirmix.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vinyl-map-1.0.2.tgz_1482215999085_0.8132491300348192"}}},"readme":"# vinyl-map\n\nMap [vinyl](https://github.com/wearefractal/vinyl) files' contents as strings,\nso you can easily use existing code without needing yet another\n[gulp](https://github.com/gulpjs/gulp) plugin!\n\nEssentially, with the hope of reducing the number of gulp plugins out there\nwhich are *just* doing this:\n\n``` javascript\nvar through = require('through')\nvar uglify = require('uglify-js')\n\nmodule.exports = function() {\n  return through(function(file) {\n    if (file.isNull()) return this.queue(file)\n    if (file.isStream()) throw new Error('no support')\n\n    file.contents = file.contents.toString()\n\n    var minified = uglify.minify(file.contents, {\n      fromString: true\n    })\n\n    file = file.clone()\n    file.contents = new Buffer(minified.code)\n    this.queue(file)\n  })\n}\n```\n\nOf course, sometimes that's fine too, but this might help save some complexity\nfor when it's too much hassle. It also takes care of the differences between\nhandling Buffer, Stream and null values for your `file.contents`.\n\n## Usage\n\nHere's a simple example, using gulp:\n\n``` javascript\nvar uglify = require('uglify-js')\nvar map = require('vinyl-map')\nvar gulp = require('gulp')\n\ngulp.task('minify', function() {\n  var minify = map(function(code, filename) {\n    // file contents are handed\n    // over as buffers\n    code = code.toString()\n\n    return uglify.minify(code, {\n      fromString: true\n    }).code\n  })\n\n  return gulp.src(['./index.js'])\n    .pipe(minify)\n    .pipe(gulp.dest('./dist'))\n})\n\n```\n\n## API ##\n\n### `map(mapper(contents, filename))` ###\n\nReturns a transform stream that takes vinyl files as input and spits out\ntheir modified copies as output.\n\n`mapper` is a function which will be called once for each file, with two\narguments:\n\n* `contents` is a string or [Buffer](http://nodejs.org/api/buffer.html)\n* `filename` is the value of `file.path`, which should generally be the file's\n  absolute path. Might be convenient if you want to filter based on file\n  extension etc.\n\nThe `mapper` function is expected to return a modified string value for the\nupdated file contents. If nothing is returned, no modifications will be made\nto the file contents, but the output file will be cloned.\n\n## License ##\n\nMIT. See [LICENSE.md](http://github.com/hughsk/vinyl-map/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"affirmix","email":"andrew@affirmix.com"}],"time":{"modified":"2022-06-28T17:31:26.947Z","created":"2014-01-11T02:59:07.109Z","0.0.0":"2014-01-11T02:59:07.109Z","0.0.1":"2014-01-11T04:31:58.537Z","0.1.0":"2014-01-23T10:53:35.544Z","1.0.0":"2014-02-08T05:05:38.180Z","1.0.1":"2014-02-17T01:30:40.400Z","1.0.2":"2016-12-20T06:40:00.982Z"},"readmeFilename":"README.md","users":{"conradz":true,"romelyus":true,"minimit":true,"drew.brokke":true,"wmhilton":true,"n370":true,"mohankethees":true,"chocolateboy":true,"dvl":true},"homepage":"https://github.com/affirmix/vinyl-map","keywords":["vinyl","gulp","gulpfriendly","file","stream","map"],"repository":{"type":"git","url":"git://github.com/affirmix/vinyl-map.git"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"bugs":{"url":"https://github.com/affirmix/vinyl-map/issues"},"license":"MIT","contributors":[{"name":"Andrew Odri","email":"andrew@affirmix.com","url":"https://affirmix.com/"}]}