本文整理汇总了TypeScript中temp.cleanupSync函数的典型用法代码示例。如果您正苦于以下问题:TypeScript cleanupSync函数的具体用法?TypeScript cleanupSync怎么用?TypeScript cleanupSync使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cleanupSync函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: String
runProc.on('close', () => {
var stalenessTrace = String(fs.readFileSync(path.join(outputDir,"testRefCount13_inst", 'staleness-trace')));
stalenessTrace = stalenessTrace.replace(new RegExp(process.cwd() + path.sep,'g'), "");
var expectedLine = '[9,"OBJECT","test/testdata/testRefCount13.js:20:19:20:38",15,["test/testdata/testRefCount13.js:25:8:25:11"],15,"test/testdata/testRefCount13.js:20:19:20:38",37,"end of program"]';
assert.ok(stalenessTrace.indexOf(expectedLine) !== -1);
temp.cleanupSync();
done();
})
示例2: testCleanupSync
function testCleanupSync() {
const cleanupResult: boolean | temp.Stats = temp.cleanupSync();
if (typeof cleanupResult === "boolean") {
const x = cleanupResult;
} else {
const { dirs, files } = cleanupResult;
dirs.toPrecision(4);
files.toPrecision(4);
}
}
示例3: testCleanupSync
function testCleanupSync() {
const cleanupResult = temp.cleanupSync()
if (typeof cleanupResult === "boolean") {
const x = cleanupResult === true;
}
else {
const { dirs, files } = cleanupResult
dirs.toPrecision(4);
files.toPrecision(4);
}
}
示例4: cleanup
export function cleanup() {
temp.cleanupSync();
}
示例5:
process.on('SIGTERM', () => temp.cleanupSync())