【文件属性】:
文件名称:then-write-file:将文件写入磁盘,使用 Promise 并创建中间目录(如果它们不存在)
文件大小:7KB
文件格式:ZIP
更新时间:2021-06-02 15:03:04
JavaScript
然后写入文件
将文件写入磁盘,使用 promise 并创建中间目录(如果它们不存在)。
安装
npm i then-write-file --save
npm test
用法
有关更多用例,请参阅
var thenWriteFile = require ( 'then-write-file' )
thenWriteFile ( './foobar.txt' , 'foo bar' )
. then ( function ( res ) {
console . log ( res )
//=> true
} )
. catch ( console . error )
有关的
: 使用 promise 优雅地解析 JSON - promisified JSON.parse
: 使用 promise 优雅地字符串化 JSON - promisified JSON.string
【文件预览】:
then-write-file-master
----.travis.yml(429B)
----index.js(885B)
----test.js(2KB)
----package.json(793B)
----CONTRIBUTING.md(1KB)
----LICENSE.md(1KB)
----.gitignore(614B)
----CHANGELOG.md(215B)
----README.md(4KB)
----.editorconfig(397B)