文件操作 - installed-shallow.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/node_modules/npm/lib/utils/completion/installed-shallow.js
编辑文件内容
const { promisify } = require('util') const readdir = promisify(require('readdir-scoped-modules')) const installedShallow = async (npm, opts) => { const names = global => readdir(global ? npm.globalDir : npm.localDir) const { conf: { argv: { remain } } } = opts if (remain.length > 3) { return null } const { global } = npm.flatOptions const locals = global ? [] : await names(false) const globals = (await names(true)).map(n => global ? n : `${n} -g`) return [...locals, ...globals] } module.exports = installedShallow
修改文件时间
将文件时间修改为当前时间的前一年
删除文件