The Built-in URL Module The URL module splits up a web address into readable parts. To include the URL module, use the require() method: var url = require(‘url’); Parse an address with the url.parse() method, and it will return a URL object with each part of the address as properties: […]

The Nodemailer Module The Nodemailer module makes it easy to send emails from your computer. The Nodemailer module can be downloaded and installed using npm: C:UsersYour Name>npm install nodemailer After you have downloaded the Nodemailer module, you can include the module in any application: var nodemailer = require(‘nodemailer’); Send an […]

  Node.js can be used in database applications. One of the most popular databases is MySQL. MySQL Database To be able to experiment with the code examples, you should have MySQL installed on your computer. You can download a free MySQL database at Install MySQL Driver Once you have […]

Creating a Database To create a database in MySQL, use the “CREATE DATABASE” statement: Example Create a database named “mydb”: var mysql = require(‘mysql’);var con = mysql.createConnection({ host: “localhost”, user: “yourusername“, password: “yourpassword” }); con.connect(function(err) { if (err) throw err; console.log(“Connected!”); con.query(“CREATE DATABASE mydb“, function (err, result) { if (err) […]

What is Node.js? Node.js is an open source server environment Node.js is free Node.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.) Node.js uses JavaScript on the server Why Node.js? Node.js uses asynchronous programming! A common task for a web server can be to open a file […]

Download Node.js The official Node.js website has installation instructions for Node.js: Getting Started Once you have downloaded and installed Node.js on your computer, let’s try to display “Hello World” in a web browser. Create a Node.js file named “myfirst.js”, and add the following code: myfirst.js var http = require(‘http’);http.createServer(function […]

Node.js is perfect for event-driven applications. Events in Node.js Every action on a computer is an event. Like when a connection is made or a file is opened. Objects in Node.js can fire events, like the readStream object fires events when opening and closing a file: Example var fs = […]

DOWNLOAD PLUGIN Description Are you frustrated by a slow website? Do over-sized images make you say “ewww”… Let EWWW Image Optimizer help you make your site faster, improve your bounce rate, and boost your SEO. But most importantly, make your visitors happier so they keep coming back for more. With […]

DOWNLOAD PLUGIN Description Safely upload SVG files to your media library and use them like any other image. Now with optional sanitization! But SVG Support has more features!!! Read on to learn more. When using SVG images on your WordPress site, it can be hard to style elements within the […]