- Learning Node.js Development
- Andrew Mead
- 173字
- 2021-06-30 18:56:46
The built-in module to use require()
Now, to kick things off, the first thing I will do is to use console.log to print Starting app, as shown in the following code:
console.log('Starting app');
The only reason we'll do this is to keep track of how our files are executing, and we'll do this only for the first project. Down the line, once you're comfortable with how files get loaded and how they run, we'll be able to remove these console.log statements, as they won't be necessary.
After we call the console.log starting app, we'll load in a built-in module using require().
We can get a complete list of all of the built-in modules in the Node.js API docs.
To view Node.js API docs, go to nodejs.org/api. When you go to this URL, you'll be greeted with a long list of built-in modules. Using the File System module we'll create a new file and the OS module. The OS module will let us fetch things such as the username for the currently logged-in user.
推薦閱讀
- 黑客攻防實戰技術完全手冊:掃描、嗅探、入侵與防御
- Modern JavaScript Web Development Cookbook
- TCP/IP入門經典(第5版)
- 正在爆發的互聯網革命
- 數字通信同步技術的MATLAB與FPGA實現:Altera/Verilog版(第2版)
- 物聯網技術與應用
- 圖解手機元器件維修技巧
- Microsoft Dynamics CRM 2011 Applications(MB2-868) Certification Guide
- Learning Storm
- 網絡綜合布線(第2版)
- Learning Node.js Development
- Implementing NetScaler VPX?
- 智慧城市中的物聯網技術
- 工業以太網技術:AFDX/TTE網絡原理、接口、互連與安全
- 網絡信息安全工程技術與應用分析