Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-r3trans

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-r3trans

Node.js wrapper for R3Trans

  • 1.0.3
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32
decreased by-73.55%
Maintainers
1
Weekly downloads
 
Created
Source

node-r3trans

Node.js wrapper for SAP R3Trans.

Installation

  • Download the R3Trans program from SAP Software Download Center
  • 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
npm install node-r3trans

Getting started

Start by importing the library and instantiating an object. If your transport is in a folder, you can pass the path as a string, like this:

const R3Trans = require('node-r3trans');
const transport = new R3Trans('C:\\R3Trans\\R904009.RST');

If your transport is a buffer:

const R3Trans = require('node-r3trans');
const trBuffer = fs.readFileSync('C:\\R3Trans\\R904009.RST');
const transport = new R3Trans(trBuffer);

Optionally, you can also pass an object containing these values:

const R3Trans = require('node-r3trans');
const transport = new R3Trans('C:\\R3Trans\\R904009.RST', {
    r3transHome: 'C:\\R3Trans' //Folder where R3Trans is placed, defaults to enviroment variable R3TRANS_HOME
    tmpFolderPath: 'C:\\R3Trans' //Folder where all temporary files are generated before being deleted, defaults to r3trans home. must have write access
});

Examples

Validate transport request

const R3Trans = require('node-r3trans');
const transport = new R3Trans('C:\\R3Trans\\R904009.RST');
transport.isValid().then(valid => {
    if(valid){
        console.log('OK');
    }else{
        console.log('NOT VALID');
    }
}).catch(e => {
    console.error(e);
});

List objects of a transport request

const R3Trans = require('node-r3trans');
const transport = new R3Trans('C:\\R3Trans\\R904009.RST');
transport.getTableEntries('TADIR').then(objects => {
    console.log(JSON.stringify(objects.map(o => `${o.R3TR} ${o.OBJECT} ${o.OBJ_NAME}`)));
}).catch(e => {
    console.error(e);
});

List all table entries of a transport request

const R3Trans = require('node-r3trans');
const transport = new R3Trans('C:\\R3Trans\\R904009.RST');
transport.getTableEntries().then(objects => {
    console.log(JSON.stringify(objects.map(o => `${o.R3TR} ${o.OBJECT} ${o.OBJ_NAME}`)));
}).catch(e => {
    console.error(e);
});

Keywords

FAQs

Package last updated on 03 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc