{"name":"temp-write","version":"3.3.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":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["tmp","temp","temporary","tempfile","file","filename","path","random","rand","write","fs","string","buffer","stream"],"dependencies":{"graceful-fs":"^4.1.2","is-stream":"^1.1.0","make-dir":"^1.0.0","pify":"^2.2.0","temp-dir":"^1.0.0","uuid":"^3.0.1"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"944fbee374d4b02d703c233164b6e32d7489b620","bugs":{"url":"https://github.com/sindresorhus/temp-write/issues"},"homepage":"https://github.com/sindresorhus/temp-write#readme","_id":"temp-write@3.3.0","_shasum":"c1a96de2b36061342eae81f44ff001aec8f615a9","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c1a96de2b36061342eae81f44ff001aec8f615a9","tarball":"http://registry-npm.ywwl.com/temp-write/download/temp-write-3.3.0.tgz","integrity":"sha512-fKkiCOLSVX0DkgmMMUU3FJ+5sqywk/Na0drathY4B3oO9hH6qIVZLMAUUjf5aDgEPRKpmAApKAflXKjzrhYLxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYkq1ZUmBYNK7VNbIWOAgd/3fLXhDnqTvKh1CoidnsyAiEAuAtr5hA+q+lBtstTpz38ZH04wSuMJYeFSmjDmT7UyeY="}],"size":2236,"noattachment":false,"key":"/temp-write/-/temp-write-3.3.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/temp-write-3.3.0.tgz_1494508923507_0.46963617275469005"},"directories":{},"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":1494508923772,"_cnpm_publish_time":1494508923772,"dist-tags":{"latest":"6.0.1"}}