{"name":"temp-write","version":"6.0.1","description":"Write data to a random temporary 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":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["temp","temporary","tempfile","file","filename","path","random","write","fs","string","buffer","uint8array","stream","data"],"dependencies":{"graceful-fs":"^4.2.11","is-stream":"^4.0.1","temp-dir":"^3.0.0"},"devDependencies":{"ava":"^6.1.3","typescript":"^5.5.4","uint8array-extras":"^1.4.0","xo":"^0.59.2"},"gitHead":"990c5cb02ef70eaf0e0f8d1beeb81ec488fabe6f","types":"./index.d.ts","_id":"temp-write@6.0.1","bugs":{"url":"https://github.com/sindresorhus/temp-write/issues"},"homepage":"https://github.com/sindresorhus/temp-write#readme","_nodeVersion":"25.3.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-6bj9LlNld+knzEOQvnZK6YxiPF+foOUjvG/WoWj1/Mt9c6f2kQCPsh8KZ+NyTk0AejubTQSPpx2alcswE1bF8g==","shasum":"b1ed81e80e120ba4957db3e01e010669d7c15870","tarball":"http://registry-npm.ywwl.com/temp-write/download/temp-write-6.0.1.tgz","fileCount":5,"unpackedSize":7035,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCYOnc/ziGYo4CYIt1IEQTsPvmGJTC5vEgzMxi1fj7W8AIhAN38bnWGQDcJ8mKNRCEsTSqjkWi9djF66XbZ1et5Bk46"}],"size":2582,"noattachment":false,"key":"/temp-write/-/temp-write-6.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/temp-write_6.0.1_1769328911275_0.0707818219169074"},"_hasShrinkwrap":false,"readme":"# temp-write\n\n> Write data to a random temporary file\n\n## Install\n\n```sh\nnpm 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 temporary file.\n\n### tempWrite.sync(fileContent, filePath?)\n\nReturns the file path of the temporary file.\n\n#### fileContent\n\nType: `string | Uint8Array | stream.Readable`\n\nThe data to write to the temporary file. Streams are supported only with the async API.\n\n#### filePath\n\nType: `string`\\\nExamples: `'img.png'` `'foo/bar/baz.png'`\n\nOptionally specify 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","publish_time":1769328911413,"_cnpm_publish_time":1769328911413,"dist-tags":{"latest":"6.0.1"}}