Skip to content

Commit 1768c8c

Browse files
DOCSP-13650 added downloadable project (#255)
* added option to download the project
1 parent 8f4889d commit 1768c8c

File tree

1 file changed

+65
-40
lines changed

1 file changed

+65
-40
lines changed

source/quick-start.txt

Lines changed: 65 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -28,74 +28,99 @@ instance.
2828
Set up Your Project
2929
-------------------
3030

31-
Install Node and NPM
31+
Install Node and npm
3232
~~~~~~~~~~~~~~~~~~~~
3333

34-
Ensure your system has Node.js version 10 or later and a compatible
35-
version of NPM (Node Package Manager) installed. For more information on how
36-
to check your version of Node and NPM and installation instructions for your
37-
system, see `downloading and installing Node.js and npm
34+
Ensure your system has Node.js version 12 or later and a compatible
35+
version of npm (Node Package Manager) installed. For information on how
36+
to check your version of Node and npm, as well as installation
37+
instructions, see `downloading and installing Node.js and npm
3838
<https://docs.npmjs.com/downloading-and-installing-node-js-and-npm>`_.
3939

40-
Initialize the Project
41-
~~~~~~~~~~~~~~~~~~~~~~
40+
.. tabs::
4241

43-
After you verify that you installed the required versions of Node and NPM,
44-
create a new project.
42+
.. tab:: Clone the Project
43+
:tabid: clone the project
4544

46-
First, create a directory for your project in your command line interface:
45+
First, install Git using `Git's Getting Started Guide
46+
<https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`__.
4747

48-
.. code-block:: none
48+
Then, in your shell, clone the `js-starter repository
49+
<https://github.com/mongodb-university/js-starter>`__:
4950

50-
mkdir node_quickstart
51+
.. code-block:: bash
5152

52-
Then, navigate into that directory so you can work directly with your
53-
project's files:
53+
git clone https://github.com/mongodb-university/js-starter.git
5454

55-
.. code-block:: none
55+
Next, navigate into the repository:
5656

57-
cd node_quickstart
57+
.. code-block:: bash
5858

59-
Next, set up NPM for your project by running the following command.
60-
This command creates a file called ``package.json``:
59+
cd js-starter
6160

62-
.. code-block:: none
61+
Then, install the Node.js driver:
6362

64-
npm init -y
63+
.. code-block:: bash
6564

66-
.. note:: Why the -y?
65+
npm install
6766

68-
If you specify the ``-y`` option in the command, NPM automatically
69-
accepts the default values for the command. Omit the ``-y`` flag to
70-
interactively select your project settings.
67+
This command performs the following actions:
7168

72-
Add MongoDB as a Dependency
73-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
69+
- Downloads and saves the ``mongodb`` package in a directory
70+
called ``node_modules``
71+
- Installs ``eslint``, which the project uses to identify and
72+
report issues in your code
73+
- Installs ``prettier``, which the project uses to format your code
7474

75-
Next, add the official Node.js MongoDB driver to your project dependencies.
76-
Use the following command to instruct NPM to download and install the
77-
``mongodb`` package.
75+
.. tab:: Create the Project
76+
:tabid: create the project
7877

79-
.. code-block:: none
78+
First, in your shell, create a directory for your project:
79+
80+
.. code-block:: bash
81+
82+
mkdir node_quickstart
83+
84+
Then, navigate into that directory:
85+
86+
.. code-block:: bash
87+
88+
cd node_quickstart
89+
90+
Next, initialize your project:
91+
92+
.. code-block:: bash
93+
94+
npm init -y
95+
96+
.. tip:: Why the -y?
97+
98+
If you specify the ``-y`` option in the command, npm uses the
99+
default values for your project settings. If you want to
100+
interactively select your project settings, omit the ``-y`` flag.
101+
102+
Then, install the Node.js driver:
103+
104+
.. code-block:: bash
105+
106+
npm install mongodb
80107

81-
npm install mongodb
108+
This command performs the following actions:
82109

83-
This command downloads ``mongodb`` package and dependencies required for its
84-
installation and saves them into a directory called ``node_modules`` in
85-
your project directory, and records the dependency information in the
86-
``package.json`` file you generated in the previous step.
110+
- Downloads the ``mongodb`` package and the dependencies it requires
111+
- Saves the package in the ``node_modules`` directory
112+
- Records the dependency information in the ``package.json`` file
87113

88-
At this point, you should have appropriate versions of Node.js and NPM
89-
installed as well as a project directory that contains the dependencies you
90-
need to use the Node.js MongoDB driver.
114+
At this point, you are ready to use the MongoDB Node.js driver with your
115+
application.
91116

92117
Create a MongoDB Cluster
93118
------------------------
94119

95120
Set up a Free Tier Cluster in Atlas
96121
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97122

98-
After installing the Node MongoDB driver, create a MongoDB instance to store
123+
After installing the MongoDB Node.js driver, create a MongoDB instance to store
99124
and manage your data. Complete the
100125
:atlas:`Get Started with Atlas </getting-started?tck=docs_driver_nodejs>` guide
101126
to set up a new Atlas account and a free tier cluster (MongoDB instance).
@@ -109,7 +134,7 @@ into your cluster.
109134
Connect to your Cluster
110135
-----------------------
111136

112-
In this step, we create and run an application that uses the Node.js MongoDB
137+
In this step, we create and run an application that uses the MongoDB Node.js
113138
driver to connect to your instance of MongoDB and run a query on the sample
114139
data.
115140

0 commit comments

Comments
 (0)