【文件属性】:
文件名称:temp-write:将stringbufferstream写入随机临时文件
文件大小:7KB
文件格式:ZIP
更新时间:2024-06-01 02:57:40
JavaScript
临时写
将字符串/缓冲区/流写入随机临时文件
安装
$ npm install temp-write
用法
import fs from 'node:fs' ;
import tempWrite from 'temp-write' ;
const filePath = tempWrite . sync ( 'unicorn' ) ;
//=> '/var/folders/_1/tk89k8215ts0rg0kmb096nj80000gn/T/4049f192-43e7-43b2-98d9-094e6760861b'
fs . readFileSync ( filePath , 'utf8' ) ;
//=> 'unicorn'
tempWrite . sync ( 'unicorn' , 'pony.png' ) ;
//=> '/var/folders/_1/tk89k8215ts0rg
【文件预览】:
temp-write-main
----index.test-d.ts(490B)
----.gitattributes(19B)
----.github()
--------funding.yml(116B)
--------security.md(179B)
--------workflows()
----test.js(1KB)
----fixture-symlink(7B)
----license(1KB)
----index.d.ts(2KB)
----fixture()
--------.gitkeep(0B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitignore(23B)
----index.js(1KB)
----readme.md(2KB)
----package.json(881B)