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

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.

主站蜘蛛池模板: 林周县| 邵武市| 云阳县| 措美县| 景德镇市| 广河县| 夏津县| 格尔木市| 淮阳县| 西昌市| 收藏| 永丰县| 湘潭市| 浦县| 黑水县| 和硕县| 宁河县| 长武县| 阜宁县| 常宁市| 常宁市| 井冈山市| 建宁县| 梁山县| 东兰县| 彭州市| 彭州市| 保靖县| 南昌县| 大同县| 金阳县| 珠海市| 罗平县| 电白县| 铜山县| 墨竹工卡县| 兰州市| 神木县| 定南县| 丹凤县| 龙海市|