文件操作 - from-path.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/from-path.js
编辑文件内容
// file dependencies need their dependencies resolved based on the // location where the tarball was found, not the location where they // end up getting installed. directory (ie, symlink) deps also need // to be resolved based on their targets, but that's what realpath is const { dirname } = require('path') const npa = require('npm-package-arg') const fromPath = (node, spec) => spec && spec.type === 'file' ? dirname(spec.fetchSpec) : node.realpath module.exports = node => fromPath(node, node.resolved && npa(node.resolved))
修改文件时间
将文件时间修改为当前时间的前一年
删除文件