官术网_书友最值得收藏!

Getting input

If a user wants to add a note, we need to know the note's title as well as the body of the note. If they want to fetch a note, we need to know the title of the note they want to fetch, and all this information needs to come into our app. And note apps, don't really do anything cool until they get this dynamic user input. This is what makes your scripts useful and awesome.

Now, throughout the book, we'll be creating note apps that get input from the user in a lot of different ways. We'll be using socket I/O to get real-time info from a web app, we'll be creating our own API so other websites and servers can make Ajax requests to our app, but in this section, we'll start things off with a very basic example of how to get user input.

We'll be getting input from the user inside the command line. That means when you run the app in the command line, you'll be able to pass in some arguments. These arguments will be available inside Node, and then we can do other things with them, such as create a note, delete a note, or return a note.

主站蜘蛛池模板: 赞皇县| 老河口市| 出国| 台安县| 玛曲县| 隆安县| 扎赉特旗| 合阳县| 普宁市| 宜黄县| 三门峡市| 托克逊县| 延寿县| 绵竹市| 阿拉尔市| 荔浦县| 舟曲县| 宝坻区| 深州市| 桦川县| 昌宁县| 乌恰县| 香港| 兰考县| 海南省| 张家界市| 高雄市| 屏东县| 巧家县| 大埔县| 沐川县| 定安县| 长兴县| 金山区| 米脂县| 元阳县| 嘉定区| 任丘市| 黄陵县| 祁门县| 绍兴市|