1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/temp-write
詹力 1a19ec897f 删除无关模块 2024-01-16 21:26:16 +08:00
..
node_modules/graceful-fs 删除无关模块 2024-01-16 21:26:16 +08:00
index.js i4 2023-12-18 13:12:25 +08:00
package.json 删除无关模块 2024-01-16 21:26:16 +08:00
readme.md i4 2023-12-18 13:12:25 +08:00

readme.md

temp-write Build Status

Write String/Buffer to a random temp file

Install

Install with npm

npm install --save temp-write

Example

var fs = require('fs');
var tempWrite = require('temp-write');

var filePath = tempWrite.sync('unicorn');
//=> /var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/4049f192-43e7-43b2-98d9-094e6760861b

fs.readFileSync(filePath, 'utf8');
//=> unicorn

API

tempWrite(input, callback)

input

Type: String|Buffer

callback(err, filePath)

Type: Function

tempWrite.sync(input)

Type: String|Buffer
Returns: the file path

License

MIT © Sindre Sorhus