10 Javascript IoT Libraries To Use In Your Next Project

Jonathan Saring
Bits and Pieces
Published in
6 min readApr 5, 2018

--

Node.js is powering the future of IoT

Some say that the day when “everything with a battery will be connected” isn’t far away. Although still in early stages, the internet of things is already revolutionizing our lives from automated production to domestic devices.

An natural combination in an event-driven world is that of IoT and Javascript. Wether it’s by Pi, Arduino or custom Bluetooth or Wifi boards, more devices become connected through Node.js every day since 2012.

To help you build your own evil Megazord or smart microwave, here are some useful libraries for accommodating Javascript in your next IOT project.

1. Johnny-Five

Johnny-five is probably the most popular Javascript robotics and IoT platform for Arduino, Raspberry Pi, Intel Edison Tessel 2 (which is even included with the project’s official getting-started kit) and more. At nearly 9k stars, this project is community driven and is receiving more popularity every day.

I said blink! hello-world with Johnny-Five

2. Cylon.js

Cylon is a Javascript framework with support for over 43 platforms for robotics, physical computing and internet of things. Want to build a robot or a drone? Cylon just might be the right place to start. Cylon can run directly in the browser (through browserify) or any Chrome-connected app, and support http/https, mqtt and socket.io plugins. Take a look.

Hello world with Cylon.js
Doesn’t really look like the rise of the machine, does it? Nodebots with Cylon.js

3. Node-Red

Node-Red was built with an idea of creating a simple, visual way to handle streams of data in the physical and digital worlds. It’s a programming tool for wiring together hardware devices, APIs and online services in interesting ways. It provides a browser-based editor that helps you wire together flows using the wide range of nodes in the palette and deploy them to the runtime. The light-weight Node runtime is full advantage of Node’s event-driven, non-blocking model. This makes it ideal to run at the edge of the network on low-cost hardware such as the Raspberry Pi as well as in the cloud.

4. Jerryscript

Jerryscript is a lightweight Javascript engine for the internet of things which enables it to run on very constrained devices and micro-controllers with less than 64 KB of RAM and less than 200 KB of flash memory. The engine supports on-device compilation, execution and provides access to peripherals from JavaScript. Defiantly worth bookmarking for your next project.

I really want a swarm of these

5. NodeMcu

Node-mcu is simple IoT platform for hardware prototyping that includes firmware and development boards to develop IoT applications that lets you write network applications using Node syntax (its programming model is similar to Node.js, but is actually based on Lua). It comes with an easy to program wireless node and/or access point with asynchronous event-driven programming model and more than 65 built-in modules.

6. IoTjs

This project is Samsung’s Javascript framework for the internet of things. This library aims to provide inter-operable service platform in the world of IoT, based on web technology, while running in resource constrained devices. It’s very actively maintained with over 1500 stars and 50 contributors.

IoT with Javascript

7. IoT-Nodejs

This project is basically client libraries and samples for connecting to IBM Watson IoT using Nodejs. IBM’s IoT Watson platform provides a clean web-based UI dashboard to manage your devices and controlling your IoT services. The client library is divided into three parts, Device, ManagedDevice and Application and can be loaded in node.js and the browser.

A robot powered by IBM’s Watson IoT platform

8. Node serialport

A Node.js package to access serial ports- Linux, OSX and Windows. It provides a stream interface for the low-level serial port code necessary to control different IoT devices by writing Javascript code.

Using Node Serial Port to communicate with Arduino

9. Bit with Node.js / Plain JS

When building multiple services and projects with Node.js and JS you probably end-up duplicating common code between them. Instead, Bit helps you easily reuse and manage shared-code across your different projects and devices. You can also utilize it to create a reusable component collection (e.g, React components) to quickly compose dashboards for your IoT devices.

Ramda functions with Bit: choose, play, install

10. Zetta

Zetta is an open source, API-first, Node.js-based platform for the Internet of Things. Built on Node.js for creating IoT servers that run across geo-distributed computers and the cloud it combines REST APIs, WebSockets and reactive programming for assembling many devices into data-intensive, real-time applications.

A connected microphone built with Zetta as part of IoT home security kit

Honorable mentions

* Mosca

A node.js mqtt broker, which can be used as standalone
or embedded in another Node.js application.

* It

A simple little JS library for consistent API across different IoT devices.

* Noduino

A JavaScript and Node.js Framework for controlling Arduino with HTML and WebSockets.

* Heimcontrol.js

Home-Automation with node.js and Raspberry PI.

* Ruff

A JavaScript runtime specialized in IoT development.

--

--

I write code and words · Component-driven Software · Micro Frontends · Design Systems · Pizza 🍕 Building open source @ bit.dev