# node-r3trans

> NodeJs wrapper for SAP R3trans program

Latest version **2.0.3** (published 2026-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-r3trans
pnpm add node-r3trans
yarn add node-r3trans
bun add node-r3trans
```

## Health

**Score 50/100 (C)** — status: active.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2026-07-05 |
| First published | 2023-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 39.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Simone Gaffurini |
| Maintainers | simonegaffurini |
| Keywords | sap, node, nodejs, wrapper, r3trans |

## Links

- npm: https://www.npmjs.com/package/node-r3trans
- Repository: https://github.com/RegestaItalia/node-r3trans
- Issues: https://github.com/RegestaItalia/node-r3trans/issues
- npm.io page: https://npm.io/package/node-r3trans

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2026-07-05
- 2.0.2 — 2026-04-27
- 2.0.1 — 2025-08-17
- 2.0.0 — 2025-08-13
- 1.5.0 — 2025-04-23
- 1.4.7 — 2025-02-25
- 1.4.6 — 2025-02-03
- 1.4.5 — 2025-01-31
- 1.4.4 — 2024-11-20
- 1.4.3 — 2024-11-18
- 1.4.2 — 2024-11-18
- 1.4.1 — 2024-11-18
- 1.4.0 — 2024-11-16
- 1.3.0 — 2024-10-15
- 1.2.0 — 2024-10-15
- … 6 more at https://npm.io/package/node-r3trans/versions

## README

# node-r3trans
![npm](https://img.shields.io/npm/l/node-r3trans)
![npm](https://img.shields.io/npm/v/node-r3trans)

NodeJs wrapper for [SAP R3trans](https://help.sap.com/docs/SOFTWARE_LOGISTICS_TOOLSET_CTS_PLUG-IN/05c12df5b54849c49940a14bc089d8b4/3dad5c974ebc11d182bf0000e829fbfe.html?locale=en-US).

## Installation
- Download the R3trans program from [SAP Software Download Center](https://support.sap.com/en/my-support/software-downloads.html)
- Create a directory and extract its content
- Create a new PATH enviroment variable named R3TRANS_HOME, pointing at the directory that was created earlier
- Install node-r3trans

```shell
npm install node-r3trans
```

## Docker support
For operating systems (e.g. MacOS) that don't support R3trans, support for dockerized R3trans program is now available (since version 2.0.0).

### Docker Image build
- Download the R3trans program from [SAP Software Download Center](https://support.sap.com/en/my-support/software-downloads.html)
- Create a directory and extract its content in a folder named "r3trans"
- Create a Dockerfile inside the root folder (you should now have Dockerfile and the r3trans folder created earlier)
- Paste this inside the Dockerfile
```dockerfile
FROM --platform=linux/amd64 debian:bookworm-slim AS collector

COPY r3trans /r3trans
RUN chmod +x /r3trans/R3trans

RUN set -eux; \
    mkdir -p /deps; \
    echo "Deps for R3trans:"; ldd /r3trans/R3trans; \
    ldd /r3trans/R3trans \
      | awk '($2 == "=>") {print $3} ($1 ~ /^\//) {print $1}' \
      | sort -u \
      | xargs -I '{}' cp -v --parents '{}' /deps

FROM --platform=linux/amd64 gcr.io/distroless/base-debian12

COPY --from=collector /r3trans /r3trans
COPY --from=collector /deps/ /

ENV LD_LIBRARY_PATH=/r3trans:/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu

ENTRYPOINT ["/r3trans/R3trans"]
```
- Go in the root folder and run this command to build the docker image
```shell
docker buildx build --platform=linux/amd64 -t local/r3trans:latest .
```

### Usage with dockerized R3trans
Make sure to flag the docker usage in the R3trans constructor:
```javascript
import { R3trans } from "node-r3trans";
const r3trans = new R3trans({
    useDocker: true
});
r3trans.getVersion().then(version => {
    console.log(version);
}).catch(err => {
    console.error(err);
});
```

## Getting started

Start by testing if the R3trans program is installed correctly and print out its version.
```javascript
import { R3trans } from "node-r3trans";
const r3trans = new R3trans({
    r3transDirPath: "", //Optional, can be used instead of the R3TRANS_HOME enviroment variable
    tempDirPath: "", //Optional, the R3trans program will generate temporary files, and this folder indicates where they shall be generated. If left blank, defaults to the R3trans program dir path
});
r3trans.getVersion().then(version => {
    console.log(version);
}).catch(err => {
    console.error(err);
});
```
### Transports

A transport data file can always be passed to the instance object methods as a buffer or a string file path.

#### To verify a transport data file is valid:
```javascript
r3trans.isTransportValid(buffer).then(valid => {
    console.log("valid", valid);
}).catch(err => {
    console.error(err);
});
```
#### Get the R3trans log as a buffer
```javascript
r3trans.getLogBuffer(buffer, 2).then(log => {
    console.log(log.toString());
}).catch(err => {
    console.error(err);
});
```
#### Get transport number
```javascript
r3trans.getTransportTrkorr(buffer).then(trkorr => {
    console.log("trkorr", trkorr);
}).catch(err => {
    console.error(err);
});
```
#### Get table entries
```javascript
r3trans.getTableEntries(buffer, "TADIR").then(tadir => {
    console.log("tadir", tadir);
}).catch(err => {
    console.error(err);
});
```

---
_Source: https://npm.io/package/node-r3trans · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
