{"name":"temp-write","version":"5.0.0","description":"Write string/buffer/stream to a random temp file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/temp-write.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["temp","temporary","tempfile","file","filename","path","random","write","fs","string","buffer","stream"],"dependencies":{"graceful-fs":"^4.2.6","is-stream":"^2.0.0","temp-dir":"^2.0.0","uuid":"^8.3.2"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"gitHead":"364b1e19300dc72617f1b06686c36f84bcd326dd","bugs":{"url":"https://github.com/sindresorhus/temp-write/issues"},"homepage":"https://github.com/sindresorhus/temp-write#readme","_id":"temp-write@5.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-cJhnzBW7DjNox7VcZDXeNlQSkIh3mX/h+M0n0Fh+zgT7YAHwI9c+OngKx4MCiQCVx9iXxV104xYlJgDBCCtawA==","shasum":"dd9aafebc93ce2067e962a1665f3873e20efb498","tarball":"http://registry-npm.ywwl.com/temp-write/download/temp-write-5.0.0.tgz","fileCount":5,"unpackedSize":6893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj784CRA9TVsSAnZWagAA/g4P/3jdDVOvZJa5pBeTEj2H\nyMyxnLybbWF13XCSH+/mHU8zQ9DJ93D3936f9H3AwHPzbugttJZKdEwdGsJx\n+49VSVmOUu8j94i1gs0S+p8kOJ8Olaw6ib9CtcTG9aeIooyj+7FjIm0fnL2F\n2oJC0XES93OtL9IZolKzeV0hKUD4CXO2HjWtb7XYiyylF2ELe9RMEqGR/rAg\nX3vG5xsAZhkUByza/n4/QyHvP8KjmSnAzZCy0V9WTXkNvEHRvlH7ksU32ZS5\nVqTz8CIqP2+plsVANfxrUzAsuGR84x4Hs0bqifH6DDjI3AOd9rN8EaFDKYfB\nW4gKrbZu2zuuIzWhS/n4L/SPzuY1wPGluYdEOoE8NaIJyLp4B1xd/nVLJ5vN\nkPnsZ+3zet1THyG2jtFqarAcOU3Z4LQkf1qID2H6VOFFBmsMBNfZxU+2ZMME\nIoouAQ+y6rEDV+H/dDnqna/A0xRjjIVBbfXH4ZhPKo9nIRwPQU2vcebtO55P\n3+Q5cO6d+9kaKIIJkC54pG7yfnrPAmtHSPOCOXDtVCTt6oG+KrWbcvwRjnaL\njdMxBBlPylcwcAmF6tgVPRGN4DOGaO2MYajFcU9fqtA+Zh6MuzNJs3WHUpwt\ndpRrnb1UI8anMhrQ4SvtAX5Jb0dZkcYtZypjySH+WbBoALSgFksbZybp+vXy\nknyc\r\n=sGnQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuMToXSKld5hjXULTQjjUaejHoPVZ+FlGl0oWoIEEa0wIhAP6b+wGoXuTg6Rz7hMq89c+GAErDKynZUygGZkVGPA0c"}],"size":2576,"noattachment":false,"key":"/temp-write/-/temp-write-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/temp-write_5.0.0_1620033335948_0.6588972219040792"},"_hasShrinkwrap":false,"readme":"# temp-write\n\n> Write string/buffer/stream to a random temp file\n\n## Install\n\n```\n$ npm install temp-write\n```\n\n## Usage\n\n```js\nimport fs from 'node:fs';\nimport tempWrite from 'temp-write';\n\nconst filePath = tempWrite.sync('unicorn');\n//=> '/var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/4049f192-43e7-43b2-98d9-094e6760861b'\n\nfs.readFileSync(filePath, 'utf8');\n//=> 'unicorn'\n\ntempWrite.sync('unicorn', 'pony.png');\n//=> '/var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/4049f192-43e7-43b2-98d9-094e6760861b/pony.png'\n\ntempWrite.sync('unicorn', 'rainbow/cake/pony.png');\n//=> '/var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/4049f192-43e7-43b2-98d9-094e6760861b/rainbow/cake/pony.png'\n```\n\n## API\n\n### tempWrite(fileContent, filePath?)\n\nReturns a `Promise` for the file path of the temp file.\n\n### tempWrite.sync(fileContent, filePath?)\n\nReturns the file path of the temp file.\n\n#### fileContent\n\nType: `string | Buffer | stream.Readable`\n\nData to write to the temp file. Streams are supported only with the async API.\n\n#### filePath\n\nType: `string`\\\nExamples: `'img.png'` `'foo/bar/baz.png'`\n\nOptionally supply a file path which is appended to the random path.\n\n## Related\n\n- [tempy](https://github.com/sindresorhus/tempy) - Get a random temporary file or directory path\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-temp-write?utm_source=npm-temp-write&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","publish_time":1620033336081,"_cnpm_publish_time":1620033336081,"dist-tags":{"latest":"6.0.1"}}