-->

    Social Items

How To Run Javascript On Google Chrome Snippet
How To Run Javascript On Google Chrome Snippet - in this post, we will learn how to run the JavaScript source code in the Google Chrome browser. Usually, if we want to create javascript, it must be embedded in HTML or web files to run, but now we will run javascript code on Google Chrome with Snippets without having to be embedded into the HTML file.

How To Run Javascript On Google Chrome Snippet


Step 1: Open Google Chrome


Picture of Google Chrome
Picture of Google Chrome

Step 2: Open the Snippets tab


  1. Right-click on google chrome
  2. Select the Inspect
  3. Open the Sources tab
  4. Select the Snippets.

Picture of Snippets tab
Picture of Snippets tab

Step 3: Create and run a new snippet


  1. New snippet
  2. Insert the name snippet
  3. Enter Javascript code
  4. To run the snippet by pressing CTRL + ENTER on the keyboard or can right-click on the file and select run.
  5. The results will be displayed on the console tab.

Picture of Hello World on the Chrome snippets
Picture of Hello World on the Chrome snippets


How To Run Javascript On Google Chrome Snippets

How To Install Sails.js With NPM

How To Install Sails.js With NPM - In this post, we will learn how to install Sails.js with npm. Sails.js is one of the MVC web frameworks built with Node.js, express.js, and Socket.io. To find out more about Sails.js, you can open the Sails.js website.

Before installing Sails.js on your computer you must first install Node.js and npm.

How To Install Node.js On Ubuntu 18.04

How To Install Sails.js With NPM


Step 1: Install Sails.js

Open the terminal and type the following command line:
$ npm install sails -g
Note: if you use Ubuntu, you can include sudo.

Step 2: Create a project

$ sails new test
Picture of creating Sails.js project
Picture of creating Sails.js project

In the command line, we will create a project with the name test. Next, we will be asked for the template selection in the form of a web app or empty. When finished, Sails.js creates the project folder test and generate the files.
Picture of Sails.js project on the web browser
Picture of the folder structure Sails.js project

Step 3: Run the project

$ cd test
$ sails lift
To see the results of the Sails.js project, we can open a browser and type 127.0.0.1:1337 in the browser address bar.

Picture of Sails.js project on the web browser
Picture of Sails.js project on the web browser

Conclusion:


Sails.js is one of the MVC web frameworks built with Node.js, express.js, and Socket.io. For Sails.js installation, we can use NPM (Node Package Manager). After the installation is complete we can create a project with Sails.js. To run the project we can type sails lift and we can see through the browser by typing 127.0.0.1:1337.

How To Install Sails.js With NPM

How To Install Node.js On Ubuntu 18.04

How To Install Node.Js On Ubuntu 18.04 - In this post, we will learn how to install Node.js on Ubuntu 18.04. Node.js is a javascript runtime environment built on the Chrome V8 JavaScript engine to execute javascript code that is open source and can run on cross-platform (all platforms). The advantages of Node.js are Highly scalable, data-intensive, and real-time apps. To find out more, go to the website Node.js.

In this tutorial, the latest version of Node.js is 11.6.0 and for the LTS (Long Term Support) version is 10.15.0, I will use the latest version in this tutorial.

How To Install Node.js On Ubuntu 18.04


Via PPA (Package Personal Archive)

Open the terminal and follow the steps of each line

Step 1: Install Dependencies

$ sudo apt-get install curl python-software-properties


Step 2: Adding PPA

For Latest Version:
$ curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
For LTS Version:
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -


Step 3: Install Node.js

$ sudo apt-get install nodejs


Step 4: Testing

$ node -v
$ npm -v
Picture of Node.js Version
Picture of Node.js Version

Step 5: Hello World (Optional)

After the installation is complete, we can try to create a hello world with Node .js. Create a file with the name of helloworld.js.
$ nano helloworld.js

Insert the code below into the file.
const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World from Codingster\n');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

To run the file we can do the following command line:
$ node helloworld.js

After the file helloworld.js running so we can view it by opening a browser and type 127.0.0.1:3000 in the address bar of the browser.

Picture Hello World with Node.js
Picture Hello World with Node.js

Conclusion:


Node.JS is a javascript runtime environment built on Chrome's V8 JavaScript engine to execute javascript code that is open source and can run on cross-platform (all platforms). There are several steps to install Node.js on Ubuntu, including adding PPA Node.js to Ubuntu, we can install Node.js with the latest version or the LTS version. The second step is to install Node.js with apt-get install. After the installation is complete we can see the version of Node.js installed on Ubuntu.

How To Install Node.js On Ubuntu 18.04

Subscribe Our Newsletter