从命令行(Node JS)在脚本中运行函数 - Run function in script from command line (Node JS)

问题:

I'm writing a web app in Node.我正在用 Node.js 编写一个 Web 应用程序。 If I've got some JS file db.js with a function init in it how could I call that function from the command line?如果我有一些带有init函数的 JS 文件db.js ,我如何从命令行调用该函数?


解决方案:

参考一: https://en.stackoom.com/question/259z3
参考二: https://stackoom.com/question/259z3
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章