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

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.

主站蜘蛛池模板: 哈尔滨市| 手游| 建始县| 资中县| 惠州市| 监利县| 临西县| 临高县| 乐安县| 铁岭县| 蓝田县| 闽清县| 平果县| 宝应县| 惠州市| 祁东县| 溧水县| 博湖县| 新泰市| 龙陵县| 科技| 金溪县| 衡阳县| 谷城县| 寿宁县| 宜黄县| 林口县| 黔东| 吴忠市| 巴马| 乌兰察布市| 卫辉市| 泌阳县| 来安县| 阿拉善右旗| 油尖旺区| 锦屏县| 蕲春县| 土默特左旗| 攀枝花市| 交口县|