我想知道perl -ne 'some expression'的简单等价物是否能够使用node,可能还有--eval '<some expression, func/arrow>'和--require some-line-by-line-enabler。有没有什么模块可以让它成为可能,或者有什么方法可以写一个?
我也找到了e.https://github.com/j-/require-cli,不知道这是不是正确的方法。我正在尝试准备一些非常基本的模块,在readline.on('line', callback)之前公开,但是使用标准输入并不是开箱即用。
发布于 2017-03-07 04:59:37
您可以从命令行使用Node对脚本求值:
node -e "console.log('Hello!')"https://stackoverflow.com/questions/42635208
复制相似问题