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

Installing yargs

Now, let's view the documents page for yargs. It's always a good idea to know what you're getting yourself into. If you search for yargs on Google, you should find the GitHub page as your first search result. As shown in the following screenshot, we have the GitHub page for the yargs library:

Now, yargs is a very complex library. It has a ton of features for validating all sorts of input, and it has different ways in which you can format that input. We will start with a very basic example, although we will be introducing more complex examples throughout this chapter.

If you want to look at any other features that we don't discuss in the chapter, or you just want to see how something works that we have talked about, you can always find it in the yarg documents.

We'll now move into Terminal to install this module inside of our application. To do this, we'll use npm install followed by the module name, yargs, and in this case, I'll use the @ sign to specify the specific version of the module I want to use, 11.0.0, which is the most recent version at the time of writing. Next, I'll add the save flag, which, as we know, updates the package.json file:

npm install yargs@11.0.0 --save
If I leave off the save flag, yargs will get installed into the node_modules folder, but if we wipe that node_modules folder later and run npm install, yargs won't get reinstalled because it's not listed in the package.json file. This is why we use the save flag.
主站蜘蛛池模板: 高青县| 洛宁县| 景德镇市| 鄂伦春自治旗| 千阳县| 河北区| 中宁县| 东宁县| 翼城县| 乐安县| 高邑县| 永德县| 集安市| 眉山市| 长丰县| 化德县| 安泽县| 赫章县| 琼结县| 禹州市| 祁阳县| 安岳县| 长宁县| 元氏县| 淳安县| 奈曼旗| 剑阁县| 米脂县| 英超| 杨浦区| 长兴县| 沛县| 桓台县| 蓬安县| 龙胜| 阿克陶县| 余干县| 余姚市| 鹤峰县| 分宜县| 常宁市|