In this episode of JavaScript for Internet of things (IoT): step by step tutorial how to wire LED on Raspberry Pi 2 with Raspbian GNU/Linux distribution and how to control it using open source project from GitHub written in JavaScript and Node.js.
Exact steps: http://www.instructables.com/id/JavaS...
Source code: https://github.com/leon-anavi/rpi-nod...
If you use Raspberry Pi Zero W you must directly use curl and tar to download armv6l versions of NPM and NodeJS from https://nodejs.org/dist/