linux - 在 node.js 脚本的 npm 内部进行拖钓的可能性

标签 linux npm linux-mint

我想知道为什么我的 npm 只能通过完整路径/usr/bin/npm 工作并打开 npm 的代码,然后发现里面有一段奇怪的歌词。这是里面的代码。它实际上通过完整路径工作,但我担心它只是发送节点的人

    npm.commands[npm.command](npm.argv, function (err) {
      // https://genius.com/Lin-manuel-miranda-your-obedient-servant-lyrics
      if (
        !err &&
        npm.config.get('ham-it-up') &&
        !npm.config.get('json') &&
        !npm.config.get('parseable') &&
        npm.command !== 'completion'
      ) {
        console.error(
          `\n ${
            npm.config.get('unicode') ? '🎵 ' : ''
          } I Have the Honour to Be Your Obedient Servant,${
            npm.config.get('unicode') ? '🎵 ' : ''
          } ~ npm ${
            npm.config.get('unicode') ? '📜🖋 ' : ''
          }\n`
        )
      }
      errorHandler.apply(this, arguments)
    })
  })
})()

最佳答案

这是 npm 代码中的彩蛋,请参阅 herehere .

$ echo 'ham-it-up=true' > ~/.npmrc
$ npm help
... < help message > ...

 🎵  I Have the Honour to Be Your Obedient Servant,🎵  ~ npm 📜🖋 

关于linux - 在 node.js 脚本的 npm 内部进行拖钓的可能性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52589703/

相关文章:

c - 转换 ioctl 参数是否违反严格的别名规则?

python - 在 crontab 上运行 python 脚本导致权限错误,但通过终端运行没问题

linux - 没有内核线程的'ps'

linux - Linux下进程间最低延迟通知方法

node.js - Yarn 本地包依赖项

node.js - process.env.USER 不是我在 Linux Mint 18.x 上所期望的

node.js - 如何使用 Nodejs 删除 Mongodb 中 JSON 格式数据中的斜线?

npm - "font-awesome"和 "components-font-awesome"之间的区别?

php - Linux Mint 18 PHP5.6 不工作

python - 尝试运行idle-python3.9(Linux Mint 20)时,tkinter.simpledialog 中缺少 _setup_dialog