文件操作 - utilities.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/nodejs/globby/utilities.js
编辑文件内容
import {fileURLToPath} from 'node:url'; import {Transform} from 'node:stream'; export const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath; export class FilterStream extends Transform { constructor(filter) { super({ objectMode: true, transform(data, encoding, callback) { callback(undefined, filter(data) ? data : undefined); }, }); } } export const isNegativePattern = pattern => pattern[0] === '!';
修改文件时间
将文件时间修改为当前时间的前一年
删除文件