opencpu-ts
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

npm version Build Status

TypeScript library for OpenCPU

Forked from https://github.com/NextCenturyCorporation/opencpu.js to make use of ES6 and TypeScript.

Installation

npm install --save opencpu-ts

Usage

import { OpenCPU } from 'opencpu-ts' Import the library
const opencpu = new OpenCPU() Instantiate a new object
await opencpu.setUrl('https://cloud.opencpu.org/ocpu/library/MASS/') Set the URL to the base package on the public server
const session = await opencpu.call('print', {x: [1,2,3]}) Call print(x=list(1,2,3))
const returnValue = await session.getObject() Get the return value (note that print also returns the value)
const consoleOutput = await session.get('stdout').then(response => response.text()) Read the console output

Readme

Keywords

Package Sidebar

Install

npm i opencpu-ts

Weekly Downloads

0

Version

0.1.2

License

Apache-2.0

Last publish

Collaborators

  • y0hy0h