{"name":"vinyl-contents","version":"1.0.0","description":"Utility to read the contents of a vinyl file.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"https://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/vinyl-contents.git"},"license":"MIT","engines":{"node":">= 6"},"main":"index.js","scripts":{"lint":"eslint .","pretest":"npm run lint","test":"nyc mocha --async-only","azure-pipelines":"nyc mocha --async-only --reporter xunit -O output=test.xunit","coveralls":"nyc report --reporter=text-lcov | coveralls"},"dependencies":{"bl":"^3.0.0","readable-stream":"^3.3.0","vinyl":"^2.2.0"},"devDependencies":{"coveralls":"github:phated/node-coveralls#2.x","eslint":"^5.16.0","eslint-config-gulp":"^3.0.1","expect":"^24.8.0","from2":"^2.3.0","mocha":"^6.1.4","nyc":"^14.1.1"},"keywords":[],"gitHead":"16d726fedec23275aca4a5748c15d8f5fe8e1e3d","bugs":{"url":"https://github.com/gulpjs/vinyl-contents/issues"},"homepage":"https://github.com/gulpjs/vinyl-contents#readme","_id":"vinyl-contents@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"dist":{"integrity":"sha512-xBH8ZUy8IK7K06eCBmd2GGjdf1EqNEGPNfRP2VsrCvSvsOggywGCGZg435WZiG/kcyCdXc1CZXCf4pUJ2EuEsg==","shasum":"f8f3456fe2dfb208a62c85653c2b682f87b5a2d5","tarball":"http://registry-npm.ywwl.com/vinyl-contents/download/vinyl-contents-1.0.0.tgz","fileCount":4,"unpackedSize":5607,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6xofCRA9TVsSAnZWagAA9dAP/jydNm+BemT5H94Y1N5H\nh8ZsKttnVUx2HFxOk6Cpg0Ryt7TssIGX9S64lY5UPiMwKcAwuKQBFNiv14Nv\nJM+lo0HNeaY5QpJi6Ool8sAIoclVdSZlTuwDxIt4T2qvEvZj2aDYJLTABQ6j\nvxeydVnfbTYwNPoIJOnmVD27xP1BlyFrNilmth69M/voXQ+wWiJKtQzb0y21\nXJC3HTzi5P29Cm0qmDSWpsN5WJ6d1XgirdOBfNdJSwBrsyUlacqyr5sfE00n\n0uH1iI0jpW1aRSVObN52n1PJpbZ3VWYDc7oPtvnbS6zD64BCy2A+95NesTjY\nMBuWmTQHEpeIJCSXPc+Y3NamZx9ZN66iLFLXX8Cj4sSg+9NwebZ0iYtaGZcj\nbuEtEEmJpeo42sNk+qYJ+hR8DKYaT82Ee56pcijo9g9DurD/411mBSJ41RH+\nAKDJmscLhY0ka2CXkGmHcnLyW32CaTrOJScu9JamxDoFMyUN85NUpKcjq2Oh\nab1EQLWrRqa82zoFSl34r97TivWc/Rj068cW94X1vY6blfzVHTApVgUQuBze\nCV1zVLaQrovzNwVoqSeAfw8PaMkz10eg9GSbVp9OUFXV33jAoF9dURwSpdh/\nAs5b6gNfFjcklGTFHX0YXh7EDbDPR2Is1Ck4yFHRULtlIhExaDQTfw/Kqo1q\nq3xL\r\n=2fBq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwR0B33DIX5qaM1ZSUWMuiT7TRtqYmm8hmSoKRxyGH8AiBnXExP01PMGiUXaI0LBHfSX9JgIfNbb/m9Z8Qefpbu2Q=="}],"size":2643,"noattachment":false,"key":"/vinyl-contents/-/vinyl-contents-1.0.0.tgz"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vinyl-contents_1.0.0_1558911518946_0.44727217681280496"},"_hasShrinkwrap":false,"readme":"<p align=\"center\">\n  <a href=\"http://gulpjs.com\">\n    <img height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\">\n  </a>\n</p>\n\n# vinyl-contents\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nUtility to read the contents of a vinyl file.\n\n## Usage\n\n```js\n/*\n  WARNING: This is a very naive plugin implementation\n  It is only meant for demonstation purposes.\n  For a more complete implementation, see: https://github.com/gulp-community/gulp-pug\n*/\nvar { Transform } = require('streamx');\nvar pug = require('pug');\nvar vinylContents = require('vinyl-contents');\n\nfunction gulpPug(options) {\n  return new Transform({\n    transform: function (file, cb) {\n      vinylContents(file, function (err, contents) {\n        if (err) {\n          return cb(err);\n        }\n\n        if (!contents) {\n          return cb();\n        }\n\n        file.contents = pug.compile(contents.toString(), options)();\n        cb(null, file);\n      });\n    },\n  });\n}\n```\n\n## API\n\n### `vinylContents(file, callback)`\n\n**Warning:** Only use this if interacting with a library that can **only** receive strings or buffers. This loads all streaming contents into memory which can cause unexpected results for your end-users.\n\nTakes a Vinyl file and an error-first callback. Calls the callback with an error if one occur (or if the first argument is not a Vinyl file), or the file contents if no error occurs.\n\nIf the Vinyl contents are:\n\n- A Buffer, will be returned directly.\n- A Stream, will be buffered into a BufferList and returned.\n- Empty, will be undefined.\n\n## License\n\nMIT\n\n<!-- prettier-ignore-start -->\n[downloads-image]: https://img.shields.io/npm/dm/vinyl-contents.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/vinyl-contents\n[npm-image]: https://img.shields.io/npm/v/vinyl-contents.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/vinyl-contents/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/vinyl-contents/dev?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/vinyl-contents\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/vinyl-contents/master.svg?style=flat-square\n<!-- prettier-ignore-end -->\n","publish_time":1558911519159,"_cnpm_publish_time":1558911519159,"dist-tags":{"latest":"2.0.0"}}