本文整理匯總了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())