> 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

{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
