文件操作 - split-package-names.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/node_modules/npm/lib/utils/split-package-names.js
编辑文件内容
'use strict' const splitPackageNames = (path) => { return path.split('/') // combine scoped parts .reduce((parts, part) => { if (parts.length === 0) { return [part] } const lastPart = parts[parts.length - 1] // check if previous part is the first part of a scoped package if (lastPart[0] === '@' && !lastPart.includes('/')) { parts[parts.length - 1] += '/' + part } else { parts.push(part) } return parts }, []) .join('/node_modules/') .replace(/(\/node_modules)+/, '/node_modules') } module.exports = splitPackageNames
修改文件时间
将文件时间修改为当前时间的前一年
删除文件