Open
Conversation
w1 hw for Ryan Fields
bwreid
reviewed
Jul 4, 2019
| * **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. |
Contributor
There was a problem hiding this comment.
And, more broadly, a "dot-file" is typically a hidden file.
| * **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.
It'll actually be node index.js. node is the program that allows to run JavaScript on our machine. npm is a package manager and gives us access to packages and scripts, among other things.
| * **Question:** What will you enter on the command line to run that script? | ||
|
|
||
| * **Your Answer:** | ||
| * **Your Answer:** node index.js start |
| * **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.
This will be npm run my-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.
An array or an object. Objects are more typical.
| * **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.
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 node_modules/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.