Developing Native Node.js Modules for Systemless Node.js

by Der_Googler
~1 minute
Developing Native Node.js Modules for Systemless Node.js

This guide will walk you through setting up node-native for Systemless Node.js.

Requirements

To develop native Node.js modules, you'll need several Magisk modules:

Setting Up Python

Currently, there is no Magisk Python module, so we will use Termux's Python.

  1. Install Python in Termux:

    # In Termux (not as root)
    pkg update && pkg install python -y
  2. Create a symbolic link for Python:

    # Run this as root
    ln -s /data/data/com.termux/files/usr/bin/python $PREFIX/bin/python

    This makes the python binary usable as root.

  3. Set up Git in a similar manner:

    # In Termux (not as root)
    pkg update && pkg install git -y
    
    # Run this as root
    ln -s /data/data/com.termux/files/usr/bin/git $PREFIX/bin/git

Running node-native

Before we can start building, we need npm!

  1. Install npm globally using yarn:

    yarn global add npm@9
  2. Clone the Git repository:

    git clone https://github.com/Googlers-Repo/node-native.git
    cd node-native
  3. Install all necessary modules:

    npm install
  4. Run your native Node.js module:

    node test.js

By following these steps, you'll have a working setup for developing and running native Node.js modules in a systemless environment. Happy coding!