從命令行(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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章