- Describe what Node.js is.
- Explain why Node.js is important.
- Upgrade Node.js to the latest version.
- Run JavaScript code using the Node.js REPL.
- Run JavaScript code using the Node.js interpreter.
- Describe what I/O is.
- Describe what the two ways to perform I/O are.
- Use the fs and path modules to interact with the filesystem.
Turn to your neighbor and describe what Node.js is. Be prepared to share your answer with the class.
Turn to your neighbor and describe why Node.js is important. Be prepared to share your answer with the class.
Make sure that Node is upgraded.
brew update
brew outdated
brew upgrade node
brew cleanupYou can check the version of Node.js by running the following command.
node -vDo a simple addition in the Javascript REPL.
In a file named hello.js, add the following code:
console.log(1 + 2);Run the file by using the following command:
node hello.jsTurn to your neighbor and describe what I/O is. Be prepared to share your answer with the class.
In a slate, write down what the two ways of performing I/O are.
Follow the instructions in the How do you use the fs and path modules to interact with the filesystem? section
- Given the commands
readandcreate, add a new command that prints out the number of guests. - Add a check so that
createdoes not add duplicate names.