本文整理汇总了TypeScript中fs-extra.write函数的典型用法代码示例。如果您正苦于以下问题:TypeScript write函数的具体用法?TypeScript write怎么用?TypeScript write使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了write函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: writeLogFile
writeLogFile(msg: string) {
const now = new Date()
let entry = `[${now}] ${msg}\n`
let fd = fs.openSync(this.acLogfilePath, 'a')
// @ts-ignore
fs.write(fd, entry)
}
示例2: Buffer
fs.fchmod(fd, modeNum, errorCallback);
fs.fchmod(fd, modeStr, errorCallback);
fs.fchmodSync(fd, modeNum);
fs.fchmodSync(fd, modeStr);
fs.lchmod(path, modeStr, errorCallback);
fs.lchmod(path, modeNum, errorCallback);
fs.lchmodSync(path, modeNum);
fs.lchmodSync(path, modeStr);
fs.statSync(path);
fs.lstatSync(path);
fs.read(0, new Buffer(""), 0, 0, null).then(x => {
const a = x.buffer;
const b = x.bytesRead;
});
fs.write(0, new Buffer(""), 0, 0, null).then(x => {
const a = x.buffer;
const b = x.bytesWritten;
});
// $ExpectType Promise<void>
fs.writeFile("foo.txt", "i am foo", { encoding: "utf-8" });
// $ExpectType Promise<string>
fs.mkdtemp("foo");
fs.copyFile("src", "dest").then();
fs.copyFile("src", "dest", fs.constants.COPYFILE_EXCL).then();
fs.copyFile("src", "dest", errorCallback);