{"name":"temp-write","version":"4.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["temp","temporary","tempfile","file","filename","path","random","write","fs","string","buffer","stream"],"dependencies":{"graceful-fs":"^4.1.15","is-stream":"^2.0.0","make-dir":"^3.0.0","temp-dir":"^1.0.0","uuid":"^3.3.2"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"199851974c8af0618e2f1a77023384823f2ae948","bugs":{"url":"https://github.com/sindresorhus/temp-write/issues"},"homepage":"https://github.com/sindresorhus/temp-write#readme","_id":"temp-write@4.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw==","shasum":"cd2e0825fc826ae72d201dc26eef3bf7e6fc9320","tarball":"http://registry-npm.ywwl.com/temp-write/download/temp-write-4.0.0.tgz","fileCount":5,"unpackedSize":6820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxbWcCRA9TVsSAnZWagAAwkQP+wSwymTGsSxIwEvvEH+f\ntl4nXNqpnNsKI0k/N3ufKVQRnDaJwayAZ+lt+SqVMmiVTIoCtr2ad5Rdm0Xk\nFsq7UMUcgFJSLQkeNWzKpTOSi5QS207Sppt/qY61TA0wx4DFQhLimQrpc56Q\nmvFF1SVIvKj/bq0GaF2MdLp4OcDXD958dXemKa/2WmxJ5MndFp3OLED1szbT\nXJD4sXp2kG9zJOC1cBFqqRlAdWV8MrUcbDZSh4GoJQwhfAdbLJgGMkeMSgQm\nnoUnwGgdj6s9E1Gc/FRoHkk0uRkAV0SlbyNWxRAAi0t5YaBKLNewgAGrwliw\n1YsNFVGttbQNe1tim9R6AsmZ2Q0a9b8DOiTlG5zA/TrRfsX0sulifKSQ5Cf8\ng5x9+pd8XBbgQMlJkI/Qq1SjTGL6hgtGnRjfAPdxnGmTWs/EhtsNntrLClwX\nffrNygYvcnU25dJQnclX3ucHpPQE8OTTPv2WVg4l+lPoGcDFKIInRtWHr71y\n5aTejmJZYo159WdFREwbxRZDXwP+b4c7caJJVO+2dny/j2obeDhB/gIcKpny\np5dxB9L9Od4umscLofj6cinMWhIPoXExg3OKtwG0wMmqwUZbfS9Rh7yKaEEF\nYO2nUeRBFZm7WeTdOl5VsdrEk0Mv/FMtOHTtorElnGlOYA6nGg+Mz55ASY8q\ndkN8\r\n=0HKb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAVGdoENYjXyfWsSYgO9M4Ewwl51H83HaVJF4P8r9lCcAiEA98vMOIZuw4B47BN5CfipzlR7bYhyov4uMB+upATE9N0="}],"size":2559,"noattachment":false,"key":"/temp-write/-/temp-write-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/temp-write_4.0.0_1556460955936_0.611654621221948"},"_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":1556460956186,"_cnpm_publish_time":1556460956186,"dist-tags":{"latest":"6.0.1"}}