-
Notifications
You must be signed in to change notification settings - Fork 31
fieldsr_w1_hw #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fieldsr_w1_hw #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,63 +38,63 @@ $ npm -v | |
|
|
||
| * **Question:** What is the difference between forking and cloning a repository as opposed to just cloning a repository? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** Fork copies to your own repo in Git. Clone creating a local copy on your dev side. | ||
|
|
||
| --- | ||
|
|
||
| - [ ] Run `npm init -y` from the command line | ||
|
|
||
| * **Question:** What does `npm init` do? How does the `-y` flag modify that command? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** npm init creates the structure of the project. -y is going to accept defaults, and use "yes". | ||
|
|
||
| --- | ||
|
|
||
| - [ ] Take a look at the file that was generated by the previous command | ||
|
|
||
| * **Question:** What is the purpose of the following keys? "name", "scripts", "license" | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** name - project name. scripts - what is going to be called. license - licenses you have used in your project. | ||
|
|
||
| --- | ||
|
|
||
| - [ ] Create a `.gitignore` file | ||
|
|
||
| * **Question:** What is the purpose of the `.gitignore` file? What is the significance of a "dot-file?" | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** Files you do not want tracked by Git. | ||
|
|
||
| --- | ||
|
|
||
| - [ ] Create an `index.js` file with the following contents: `console.log('Hello, Node!')` | ||
|
|
||
| * **Question:** From the command line, how can you run this file? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** npm index.js | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'll actually be |
||
|
|
||
| --- | ||
|
|
||
| - [ ] Run `npm test` from the command line | ||
|
|
||
| * **Question:** What happens and how is this related to what is in the `package.json` file? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** It looks in the package.json and executes what is defined in the test script. | ||
|
|
||
| --- | ||
|
|
||
| - [ ] Create a new "script" command called "start" that has the following value: `node index.js` | ||
|
|
||
| * **Question:** What will you enter on the command line to run that script? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** node index.js start | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be |
||
|
|
||
| --- | ||
|
|
||
| - [ ] Change the name of your "start" script to "my-file" | ||
|
|
||
| * **Question:** The same pattern will not work to try and run this script. How can you successfully get this script to run? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** node index.js my-file | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be |
||
|
|
||
| --- | ||
|
|
||
|
|
@@ -111,19 +111,19 @@ $ npm -v | |
|
|
||
| * **Question:** What gets logged? Why? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** My name / age I added to the log portion of index.js. | ||
|
|
||
| * **Question:** What is `module.exports` and what is its _type_ in JavaScript? What is `require` and what is its _type_ in JavaScript? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** module.exports is a special object that is exposed as a module. require is a built in function. | ||
|
|
||
| --- | ||
|
|
||
| - [ ] We can only export one thing from files when using Node. With that said, export both your name and your birthday from the `profile.js` file. | ||
|
|
||
| * **Question:** What are some ways you can solve this problem? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** You can use an array to export more than one value. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An array or an object. Objects are more typical. |
||
|
|
||
| --- | ||
|
|
||
|
|
@@ -135,23 +135,23 @@ $ npm -v | |
|
|
||
| * **Question:** What is `path` and where does it come from? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** Path is a module we import and is installed by NPM. | ||
|
|
||
| --- | ||
|
|
||
| - [ ] Install the [moment](https://www.npmjs.com/package/moment) package | ||
|
|
||
| * **Question:** What command can you run to install this package? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** npm install package_name | ||
|
|
||
| --- | ||
|
|
||
| - [ ] On your own, use this package in the `index.js` file | ||
|
|
||
| * **Question:** Do you need to use a `./` to require the package? Why or why not? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** ./ lets node know to look in the same realitive path it is running inside of. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, and in this case we are not looking for a relative file path but instead an installed module. In that case, we'll look inside of |
||
|
|
||
| --- | ||
|
|
||
|
|
@@ -160,4 +160,4 @@ $ npm -v | |
| #### Resources | ||
|
|
||
| - [Node.js Built-In Modules](https://nodejs.org/dist/latest-v12.x/docs/api/) | ||
| - [NPM: Moment](https://www.npmjs.com/package/moment) | ||
| - [NPM: Moment](https://www.npmjs.com/package/moment) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, more broadly, a "dot-file" is typically a hidden file.