> For the complete documentation index, see [llms.txt](https://docs.viesus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.viesus.com/installation/nodejs.md).

# Node.js Module

Install the VIESUS Node.js native module on Ubuntu 22.04 with Node.js 18 and NVIDIA GPU support.

{% hint style="info" %}
**Linux Only**

The VIESUS Node.js module is available on **Linux only**.
{% endhint %}

See [System Requirements](/installation/requirements.md) for hardware, OS, Node.js, and NVIDIA driver requirements.

***

{% stepper %}
{% step %}

## Install VIESUS

```bash
sudo dpkg -i viesus-redist_<VERSION>_amd64.deb \
             viesus_<VERSION>_amd64.deb \
             viesus-license_<VERSION>_amd64.deb

sudo apt-get install -f
```

Verify NVIDIA driver:

```bash
nvidia-smi
```

The CUDA version shown must be **12.6 or higher**.
{% endstep %}

{% step %}

## Install Node.js 18

```bash
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt -y install nodejs
```

Verify:

```bash
node --version   # v18.x.x
npm --version
```

{% endstep %}

{% step %}

## Set up your project

```bash
mkdir myproject && cd myproject
npm init -y
```

Install the VIESUS native module from the local package:

```bash
sudo npm install /usr/local/viesus/node-viesus
```

Install the worker thread pool helper:

```bash
npm install node-worker-threads-pool --save
```

{% endstep %}

{% step %}

## Copy example files

```bash
cp -a node_modules/viesus/test/* .
```

This copies `testbatch.js`, `worker.js`, and a default `viesusini.json` into your project directory.

Edit `testbatch.js` and insert your GUID:

```js
const guid = "YOUR-GUID-HERE";
```

{% endstep %}

{% step %}

## Set thread pool size

Set `UV_THREADPOOL_SIZE` before running. A good starting value is the number of CPU cores:

```bash
export UV_THREADPOOL_SIZE=16
```

{% endstep %}

{% step %}

## Run a test

```bash
mkdir in out
# Copy some test images to ./in/

node testbatch.js
```

Output lines `> 0` indicate successful processing (value is processing time in ms). Negative values are error codes — see [API Reference](/reference/node.js-module/api-reference.md#error-codes).
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.viesus.com/installation/nodejs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
