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

Initialization of an application

The first step we'll take inside of the Terminal is that we'll make a directory to store all of these files. We'll navigate from our home directory to the desktop using the cd Desktop command:

cd Desktop

Then, we'll make a folder to store all of the lesson files for this project.

Now, these lesson files will be available in the resources section for every section, so if you get stuck or your code just isn't working for some reason, you can download the lesson files, compare your files, and figure out where things went wrong.

Now, we'll make that folder using the mkdir command, which is the short form for make directory. Let's call the folder notes-node, as shown in the following code:

mkdir notes-node

We'll make a note app in Node so that notes-node seems appropriate. Then we'll cd into notes-node, and we can get started playing around with some of the built-in modules:

cd notes-node

These modules are built in, so there's no need to install anything in Terminal. We can simply require them right inside of our Node files.

The next step in the process is to open up that directory inside the Atom text editor. So open up the directory we just created on the Desktop, and you will find it there, as shown in the following screenshot:

Now, we will need to make a file, and we'll put that file in the root of the project:

We'll call this file app.js, and this is where our application will start:

We will be writing other files that get used throughout the app, but this is the only file we'll ever be running from Terminal. This is the initialization file for our application.

主站蜘蛛池模板: 固原市| 谢通门县| 临清市| 浦县| 自贡市| 余庆县| 陆川县| 高密市| 凤阳县| 永新县| 磐石市| 苏尼特右旗| 建阳市| 徐水县| 宜阳县| 潜山县| 宁远县| 伊宁市| 全椒县| 玉溪市| 宝丰县| 谢通门县| 威远县| 阿拉善盟| 蒙山县| 郑州市| 云南省| 南城县| 乐都县| 府谷县| 临湘市| 宝兴县| 大悟县| 绥化市| 北海市| 敦煌市| 凉城县| 高安市| 庆城县| 邯郸县| 泸水县|