- Learning Node.js Development
- Andrew Mead
- 126字
- 2021-06-30 18:56:57
Adding and saving notes
In the previous section, you learned how to work with JSON inside Node.js, and this is the exact format we'll be using for the notes.js application. When you first run a command, we'll load in all the notes that might already exist. Then we'll run the command, whether it's adding, removing, or reading notes. Finally, if we've updated the array, like we will when we add and remove notes, we'll save those new notes back into the JSON file.
Now, this will all happen inside of the addNote function, which we defined in the notes.js application, and we already wired up this function. In earlier sections, we ran the app add command, and this function executed with the title and body arguments.
推薦閱讀
- 物聯網(IoT)基礎:網絡技術+協(xié)議+用例
- WordPress 5 Complete
- 網絡的琴弦:玩轉IP看監(jiān)控
- 2018網信發(fā)展報告
- 物聯網通信技術
- 網絡安全應急響應技術實戰(zhàn)
- Windows Server 2012 Hyper-V虛擬化管理實踐
- 網絡環(huán)境中基于用戶視角的信息質量評價研究
- 光纖通信系統(tǒng)與網絡(修訂版)
- Echo Quick Start Guide
- 互聯網+思維與創(chuàng)新:通往未來的+號
- 物聯網工程概論
- 一本書讀懂TCP/IP
- Laravel Application Development Cookbook
- 商業(yè)的本質和互聯網