- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Using the Node.js
Steps to Install Node.js
Step 1 − Download the NodeJs from here according to your personal computer’s device specification.
Step 2 − Open the installed .exe file of Node.js and install the Node.js to your local computer.
Step 3 − To check that Node.js is correctly installed, open the terminal and type the below command. It should show you the version of the Node.js.
Now, to run the above code at the terminal, open the terminal and go to the folder where the current file locates. Users can use the cd command to go to the file directory.
After going to the file directory, enter the below command to the terminal.
Welcome to the tutorialsPoint!
Users can see that program executed successfully and prints the above output.
Steps to writing code in terminal
Step 1 − Install Node.js and enter the below command to the command prompt. It will show you a welcome message in the terminal.
Enter every step in the terminal line by line.
The function will call when you add the last line of the function call in your terminal and it prints the below output.
The Value of a + b is 30.
Using the Nashorn Java Engine
To use the Nashorn engine, users must have installed Java on their local computer. You can find the JJS tool inside the bin folder of JDK installation, with the other tools like Jar.
Add the below code to the file called hello.js.
Now, users need to run the below file using the JJS tool in the command prompt. Go to the file directory, and enter the below command to the terminal.
Tutorial Points is the best site to learn computer science things.
- Print structured MySQL SELECT at command prompt
- How do we print a variable at the MongoDB command prompt?
- How can we establish MySQL database by using MySQL binary at command prompt?
- How can I see how long statements take to execute on the MySQL command line?
- How to run PowerShell commands from the command prompt?
- Getting MySQL path in command prompt
- How to run a PowerShell script from the command prompt?
- How to execute Python multi-line statements in the one-line at command-line?
- After connecting to MySQL server how can we select a database from command prompt?
- How can you execute functions with multiple arguments at a terminal?
- How to compile & run a Java program using Command Prompt?
- How to run a JAR file through command prompt in java?
- How to execute a command and get the output of command within C++ using POSIX?
- How to install a windows service using windows command prompt in C#?