Many programmers are familiar with Node.js, but NodeOS](https://node-os.com/) might be less familiar. This operating system is primarily written in Node.js, although it utilizes the Linux kernel for performance-intensive tasks like hardware interaction. Developed over the past two years, NodeOS is driven by the intriguing idea of creating an operating system solely with Node.js.

Why is this significant?
Firstly, consider the rapid advancements of Node.js in its short lifespan. Now, envision similar progress in an operating system. Add to that some innovative features.
Isolated User Filesystems
NodeOS presents a novel concept: each user has an independent root filesystem. This simplifies file management as their home folder acts as the root directory, allowing global package installations without needing special permissions. This also enhances security by isolating users, preventing a potential breach from compromising the entire system.
Node.js and NPM Integration
With Node.js at its core, NodeOS leverages the vast NPM package repository. Currently boasting over 200,000 packages and growing, this integration could potentially provide NodeOS with millions of applications in the near future.
Linux Kernel Foundation
NodeOS builds upon the widely used Linux kernel, enabling compatibility with applications designed for other Linux distributions, with minimal adjustments.
Current Limitations
While promising, NodeOS is still under development and lacks certain features crucial for a server operating system. Notably absent are common BASH utilities like ps, tail, nano, and grep. Additionally, the lack of a GUI hinders its use as a desktop operating system. While some functionalities can be implemented with JavaScript, their absence by default is a drawback.
Exploring NodeOS
Using Docker
The simplest method to experience NodeOS is through Docker on a Linux or Mac OSX machine (Windows compatibility is untested). After Docker installation, executing the following command initiates the process:
| |

Docker automatically downloads the NodeOS image, installs it within a virtual machine, and establishes an SSH connection to the NodeOS shell.
Without Docker
Using the source code offers access to the latest NodeOS version, which might be more recent than the Docker image. However, this approach requires:
- A Linux computer (compilation on OSX or Windows is possible but slower)
- Linux build tools (
make,g++,gcc,autoconf) - Qemu
- Significant time
The compilation process involves:
- Cloning the repository:
bash git clone git@github.com:NodeOS/NodeOS.git. - Navigating to the directory and installing dependencies:
cd NodeOSandnpm install. - Allocating considerable time for compilation.
- Running
bash npm startto launch NodeOS within Qemu.
Functionality Check
Upon successful installation, basic functionality can be tested with the ls command, producing an output similar to:
| |
Attempting to use the ifconfig command, however, might result in:
| |
This absence highlights the reliance on NodeOS’s npkg package manager, similar to apt or yum. Installing ifconfig is achieved with:
| |
Subsequently, executing ifconfig should display network information, confirming successful installation:
| |
Utilizing NodeOS
The true potential of a Node.js-based operating system lies in developing applications solely with Node.js. As an example, let’s create a simple man command functionality, which is not available by default.

Firstly, install a basic text editor called Hipster: npm install -g hipster@0.15.0. Create and save files using commands like hip filename, Ctrl + s, and Ctrl + q for exiting. The following example code is sourced from a NodeOS developer and can be found in the node-bin-man Git repository.
A typical Node.js application starts with a package.json file:
| |
The parameters like name, version, description, etc., are self-explanatory. The bin field maps the man command to the man.js file. Dependencies are listed under dependencies.
Next, the main code:
| |
This shebang line, while not mandatory in NodeOS, instructs the system to execute the script using /usr/bin/env node.
| |
The require() function loads the necessary Blessed package.
| |
This section mimics the default behavior of the man command, displaying its own manual if no other command is specified.
| |
The code then checks for a README.md file in the application’s installation path. If found, the content is stored in the readme variable.
| |
Blessed’s API simplifies displaying the content within a created box.
| |
This part defines exit functionality using key combinations.
| |
Scrolling through the content is enabled using specific keys.
| |
Finally, the focus is set on the created box, and the content is rendered. Place these files in the /lib/node_modules/bin-man directory and create a README.md file:
| |
Lastly, create a config file at /etc/bin-man/config.json containing an empty JSON object: {}.
Now, running man within the NodeOS shell should display the created readme file.
Conclusion
This simple example illustrates the ease of developing applications for NodeOS using just Node.js. While still in its early stages, NodeOS holds immense potential. With continued development and the growing popularity of the Node.js ecosystem, it could evolve into a significant operating system. What are your thoughts? Share them in the comments.