Learn JavaScript with Raspberry Pi

By PJ Evans. Posted

Beginner’s Guide to Installing Node.js on a Raspberry Pi

Author: Dave Johnson
Price: Free
Link: Beginner’s Guide to Installing Node.js on a Raspberry Pi

dave

JavaScript is a programming language. To be useful, something has to run that code. JavaScript is most commonly used in web browsers, to make websites dynamic and easier to use. You can also run JavaScript on the command line, just like Python. The application that handles this is called Node.js. Unlike Python, Node.js is not installed in Raspbian by default and there are different versions for different hardware. Luckily, Dave Johnson has written an excellent guide to take you through the process.

What sets Dave’s guide apart from others is how current it is. Node.js is a fast moving-platform with releases coming thick and fast. At time of writing, the guide is covering the very latest version of Node.js, 13. Sadly, although you can install Node.js from APT without any fuss, you will get a much older version and miss out on many performance enhancements for the Raspberry Pi range. Dave’s guide explains how to add the NodeSource repository and get the latest and greatest Node.js versions on Raspbian.

NodeSchool

Price: Free Link: NodeSchool

NodeSchool

NodeSchool is an astounding resource for learning not only JavaScript but many of the tools you need to get the most out of the experience. The tutorials available are installed as a series of command-line applications that allow you to create your code for real and then have it verified automatically. This means you are breaking out of the sandbox and coding for real.

Starting with the very basics of JavaScript, you soon progress to the Node.js environment and then on to more advanced topics such as data streaming. You can even build your own workshops! Furthermore, NodeSchool organises and runs workshops and regular groups all over the world, so beginners can get support and friends. A perfect resource for those who prefer to collaborate.

Node.js in Action (2nd Edition)

Author: Alex Young, Bradley Meck, Mike Cantelon Price: £18 Link: Node.js in Action

Node.js in action

Manning Publications has been a supporter of Node.js since its inception in 2009. This had been showing a bit with the original Node.js in Motion book getting a bit out of date as Node.js versions raced ahead. Now the book has been brought up to date to be in line with modern Node.js practices. While it doesn’t cover the most recent developments (Node.js progresses so rapidly, it would be impractical), what the book excels at is giving a thorough grounding in how Node.js works under the bonnet, really helping the reader understand some of the key concepts that make Node.js different from browser-based JavaScript. There’s also a video course available (you may recognise the presenter).

Essential resources

Learning JavaScript and Node.js? You’re going to need these…

NPM

Node Package Manager is like Python’s pip for Node. Literally thousands of libraries to enhance your project can be installed in a single command. Always start here to avoid reinventing the wheel.

NPM

MDN Web Docs

This free resource from Mozilla is like the Library of Alexandria for internet development, amongst which you’ll find comprehensive documentation on all versions of JavaScript with examples and browser support information.

Stack Overflow

Every developer’s little secret. A gigantic Q&A site for many subjects including Raspberry Pi, JavaScript, and Node.js. Chances are the answer to your question is here somewhere.

Amazing frameworks

Frameworks allow your JavaScript code to do amazing things

Express.js

Think writing a web server from scratch is difficult? It certainly was until Express.js came along. This library and command-line tool can scaffold a full working server in seconds, perfect for web apps and APIs.

Electron.js

Electron

Electron takes the components of your web app, the JavaScript, HTML and CSS, and packages it all with a web browser to create a standalone application that can be compiled for many different platforms.

Sequelize

If databases are your thing but you find SQL a bore, this object-relational mapping (ORM) framework makes creating, managing, and using databases a joy. Supports many platforms and integrates with Express.

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.