New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-r-runner

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-r-runner

Node.js module for running R scripts

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

node-r-runner

Experimental

Node.js module for running R scripts

Installation

R needs to already be installed, and jsonlite R library needs to be installed.

yarn add node-r-runner or npm install node-r-runner

Usage

In an R file:

input[[1]] + input[[2]]

In node:

const { R } = require('node-r-runner')

let r = new R('./add.R')

// optionally pass an options object used in child_process spawn calls
let r = new R('./add.R', {env: {PATH: '/bin:/location/to/R/bin'}})

// data is converted to a list variable `input` in the R script
r.data(2, 3)

// call the script async
r.call()
  .then(response => response === 5) // true
  .catch(e => console.log('error : ', e))

// OR call the script async

let result = r.callSync() // could raise an exception
result === 5 // true

FAQs

Package last updated on 25 May 2021

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