Learn JavaScript by adventuring around in the terminal.
Looking for more interactive tutorials like this? Go to nodeschool.io.
Having issues with javascripting? Get help troubleshooting in the nodeschool discussions repo, or on gitter:
The goals of this lesson is to help you become more comfortable with cloud9, bash git and basic javascript.
a github account will be needed to move forward in the course. If you do not already have one you can signup here: Github
Before we start the lesson we need to configure cloud9 to use your git account In the terminal run:
$ git config --global user.name "Mona Lisa"
Replace Mona Lisa with your github name
Second step:
$ git config --global user.email "email@example.com"
Replace email@example.com with the github email address on you used for your github account
Run all the steps in the terminal
- Create a folder named: challenges
- change the directory into challenges folder
- Create another folder week-1
- change the directory into week-1
- Create another folder javascripting
- Clone this repository into javascripting folder
$ git clone https://github.com/SoftStackFactory/nodeschool-javascripting.git
Bash Commands Hint:
- cd change directory
- mkdir create new folder
Open your terminal and run this command:
npm install --global javascripting
The --global
option installs this module globally so that you can run it as a command in your terminal.
If you get an EACCESS
error, the simplest way to fix this is to rerun the command, prefixed with sudo:
sudo npm install --global javascripting
You can also fix the permissions so that you don't have to use sudo
. Take a look at this npm documentation:
https://docs.npmjs.com/getting-started/fixing-npm-permissions
Open your terminal and run the following command:
$ javascripting
You'll see the menu:
Navigate the menu with the up & down arrow keys.
Choose a challenge by hitting enter.
Create a file when you start a challenge Ex: challenge-1.js We can use the command touch in the terminal to create a file.
$ touch challenge-1.js
To test your code and pass the challenge run in your terminal:
$ javascripting verify challenge-1.js
Note is a placeholder replace everything with the exact name.
touch <filename>
touch challenge-1.js
- Create a new file for the challenge File name example: challenge-1, challenge-2
$ touch <filename>
- Test your solution with:
$ javascripting verify <filename>
- Now once we have passed the javascripting test we can check the status of our the files that have changed in the terminal run:
$ git status
Files in red font are changes to files that are not staged and will not be apart of the commit 4. Lets *add our changes so they will be apart of the commit.
$ git add .
This will add all our files that were changed and are now staged or ready to be commited.
- Lets commit all the files we added in the previous step but first it is good practice to see what will be commited buy running:
$ git status
Now you should see files in green font that will be apart of the commit. Now lets commit the files with:
$ git commit -m "message about what you did here"
- Now run the javascripting program to select a new lesson:
$ javascripting
- Create a new file for that lesson.
$ touch <file-name>
Ask for help in glip or try the discussion boards below
Open an issue in the nodeschool/discussions repo: https://github.com/nodeschool/discussions
Include the name javascripting
and the name of the challenge you're working on in the title of the issue.
MIT