{"name":"vinyl-contents","version":"2.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":">=10.13.0"},"main":"index.js","scripts":{"lint":"eslint .","pretest":"npm run lint","test":"nyc mocha --async-only"},"dependencies":{"bl":"^5.0.0","vinyl":"^3.0.0"},"devDependencies":{"eslint":"^7.0.0","eslint-config-gulp":"^5.0.0","eslint-plugin-node":"^11.1.0","expect":"^27.0.0","mocha":"^8.0.0","nyc":"^15.0.0","readable-stream":"^3.6.0","streamx":"^2.12.5"},"nyc":{"reporter":["lcov","text-summary"]},"prettier":{"singleQuote":true},"keywords":[],"gitHead":"d364c545d3b39d0ec91a95355dd4fa1a94ee0e15","bugs":{"url":"https://github.com/gulpjs/vinyl-contents/issues"},"homepage":"https://github.com/gulpjs/vinyl-contents#readme","_id":"vinyl-contents@2.0.0","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"integrity":"sha512-cHq6NnGyi2pZ7xwdHSW1v4Jfnho4TEGtxZHw01cmnc8+i7jgR6bRnED/LbrKan/Q7CvVLbnvA5OepnhbpjBZ5Q==","shasum":"cc2ba4db3a36658d069249e9e36d9e2b41935d89","tarball":"http://registry-npm.ywwl.com/vinyl-contents/download/vinyl-contents-2.0.0.tgz","fileCount":4,"unpackedSize":5022,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwB0HL76RkdAOuPmQ5CdTEexd8hKcp6jFwDkjhuCeaCwIhALt6Q3V8qx+xRm86spiLTI2vaKi7jsuGRz/5rJNxnQ6f"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQgiMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBCQ/9F55b0FNEby/BA09EfwyxGrqVvSfcd+KOpl45L5S5Bz+0lzRD\r\nI9QEESxcfUUEbyQCW2bBGjHPbYb2l1NAMfv+GRBQ0lf4nEjKtS+/nr5r8hQU\r\nrHyJKr7Qlnl2graV02xJjfSURd6Oo30QgwMcTWCi+CNrVYUpCRwS+6K7BJmR\r\nensuM6wI4WeZiOGCcnn5a/Knf1TZ0Uzanu1Sb97UvUa7nMSTA4/aaEv5LKWT\r\njT6PQH9GmQ+IE7DrUAWA31fBvfzQ9FNbga5mQazyB1g3+GPqftP3k8bThXQH\r\nvQhREyAjF+IKvKkNIdiKniXtTC7JT/GiPpdx2yH/17RIubmSvScS5AjjMOvd\r\nanP8UbyoQD3X5G6KFlp1OPE4oxo4bpwh8dfJEZQSwszkfitNuIr9TKxQv8BX\r\nCxh9mZH5mcuDypYs8SqrKtAIQr5KB3Czr2L/f04rn3bvwq7tOiHk8/KVy4Wo\r\ntV7aJtf5nzTXI/WAUDCZNtZ1LjJHSJf7C3U2E35iMjIPdqjjIogA4jwJ90Wz\r\n21wm6BH+Ov2ukeilsr8SmnJv7G+hryt8FAqtdwrgO6G/nCJKOH83t6+H00OJ\r\nYQnyGl1RXqogTvUWTMG2vYI486NqN292bV87mbVvLrHDdQeh/exQfXTajG76\r\nqN3DuKZYwrY7+1l79ytmqJz8ra+7GRIrTfI=\r\n=RMB8\r\n-----END PGP SIGNATURE-----\r\n","size":2450,"noattachment":false,"key":"/vinyl-contents/-/vinyl-contents-2.0.0.tgz"},"_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"directories":{},"maintainers":[{"name":"yocontra","email":"yo@contra.io"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vinyl-contents_2.0.0_1665271948515_0.69998670267211"},"_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":1665271948660,"_cnpm_publish_time":1665271948660,"dist-tags":{"latest":"2.0.0"}}