- Learning Node.js Development
- Andrew Mead
- 202字
- 2021-06-30 18:57:00
Summary
In this chapter, you learned that parsing in process.argv can be a real pain. We would have to write a lot of manual code to parse out those hyphens, the equal signs, and the optional quotes. However, yargs can do all of that for us and it puts it on a really simple object we can access. You also learned how to work with JSON inside Node.js.
Next, we filled out the addNote function. We're able to add notes using the command line, and we're able to save those notes into a JSON file. Finally, we pulled out a lot of the code from addNote into separate functions, fetchNotes and saveNotes, which are now separate, and they're able to be reused throughout the code. When we start filling out the other methods, we can simply call fetchNotes and saveNotes instead of having to copy the contents over and over again to every new method.
In the next chapter, we'll continue our journey on node fundamentals. We'll explore some more concepts related to node, such as debugging; we'll work on the read and remove notes commands. Apart from this, we'll also learn about the advanced features of yargs and the arrow function.
- 廣電5G從入門到精通
- OpenLayers Cookbook
- 物聯網+BIM:構建數字孿生的未來
- Web Application Development with R Using Shiny
- WordPress 5 Complete
- Spring Cloud微服務架構進階
- 數字調制解調技術的MATLAB與FPGA實現:Altera/Verilog版(第2版)
- Working with Legacy Systems
- VMware NSX網絡虛擬化入門
- 物聯網工程概論
- 人人都該都懂的互聯網思維
- Qt5 Python GUI Programming Cookbook
- Python API Development Fundamentals
- SEO攻略:搜索引擎優化策略與實戰案例詳解
- 智能物聯網:區塊鏈與霧計算融合應用詳解