//公用方法 import { rm as removeFile } from 'node:fs/promises'; export default { getTimeString: function(locales) { const today = new Date(); if (typeof(locales) == 'undefined') {locales = 'zh-CN';} return today.toLocaleString(locales); }, removeFile: async function(filepath) { let done = false; try { done = await removeFile(filepath, {force: true}); }catch(error) { console.error('Remove task file failed: %s', error); } return done; } };