本文整理汇总了TypeScript中fs.unlink函数的典型用法代码示例。如果您正苦于以下问题:TypeScript unlink函数的具体用法?TypeScript unlink怎么用?TypeScript unlink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unlink函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
.on('error', (err: Error) => {
winston.error(`Error downloading: ${err.message || 'unknown'}`)
fs.unlink(filename, resolve.bind(undefined, undefined))
})
示例2:
fs.readFile(fileName, "utf-8", (err, data) => {
fs.unlink(fileName, done);
assert.equal(data, expectedText);
});
示例3: unlink
return Promise.fromCallback((cb) => {
return unlink(this.getPath(), cb);
}).then(() => true).catch(() => false);
示例4: handleResult
return new Promise<void>((resolve, reject) => {
fs.unlink(path, error => handleResult(resolve, reject, error, void 0));
});
示例5:
rs.once('end', () => {
fs.unlink(tmp);
});
示例6: cb
(cb) => { fs.unlink(path.join(server.projectPath, "members.json"), (err) => { cb(); }); }
示例7:
(error) => {
logger.error('Error: Got error ' + error + ' from ' + fileUrl);
fs.unlink(filePath);
})
示例8: writeFile
writeFile(serverPath, serverString, err => {
if (err) return eachCallback(err)
return unlink(iso639Path, eachCallback)
})
示例9: after
after(done => {
unlink('delme.json', done);
});
示例10: it
it("should generate a file with a .js or .ts extension", () => {
const glyphFolderPath: string = path.resolve(__dirname, "./__tests__/");
const glyphConverter: ConvertGlyphs = new ConvertGlyphs(({glyphFolderPath, indexFileType: "ts"} as IConvertGlyphOptions));
fs.unlink(`${glyphFolderPath}/index.ts`, (err: Error) => { if (err) { throw err; } });
});