Giter Club home page Giter Club logo

rxcute's Introduction

rxcute

NodeJs execute rscript library

Main Idea

Presently, all developers have found inconvenient programming connect to multiple data sources such as Text file, CSV, Excel, Oracle, MSSQL, MySQL, Postgres, MongoDB, Redis, Elasticsearch and etc. I’ve experienced programming in C# and NodeJS which available connect any data sources by driver but need to learn it on different ways and might have some configuration problem. Oh! so many things to do. My idea is that needs to use only one programming language to solve these problems. I want simplest way and native support each data sources too. R language is the best choice that I knew. It is programming language and software environment for statistical analysis, graphics representation and reporting. R is most popular for data scientist and statistics. This solution can separate task by suitable skill of people too. It help to solve 2 main problems of technical and people.

Road Map

  • 0.0.1 => simple execute R script
  • 0.1.0 => multiple scripts execution next 1 month
  • 1.0.0 => return result to ORM next 2 month
  • 1.1.0 => meta structure rule for each device

Prerequisites

Installation

npm install rxcute

How to use

const R = require('rxcute');
var r = new R();

r.exec(rScript, parameter, options, callback);
r.execSync(rScript, parameter, options);
  • rScript > R Script file to execute.
  • parameter > parameter is string which can be any formats such as JSON, XML, array, number, string, etc but need to convert to correctly format in R script.
  • options > optional of R console such as "max.print=100"
  • callback > callback function for asynchronous execution.

Example

//init
const R = require('rxcute');
var r = new R();

r.exec('./example/hello.R',null,function(result){
	  console.log(result);
})
// insert data to MongoDB

r.exec('./example/insertData.R',{firstName:"John", lastName:"Doe"},function(result){
	  console.log(result);
})
//get data from MongoDB and limit result only 100 records

r.exec('./example/getData.R',null,'max.print=100',function(result){
	  console.log(result);
})

var result = r.execSync('./resources/getData.R',null,'max.print=100');
	console.log('result => ', result.toString())

result

  • status => 200 : Successfully => 500 : Error
  • output => result as string
  • all of result need to convert to be format as you need to use.
  • for example of mongodb you need to install mongolite and jsonlite

rxcute's People

Contributors

apaichon avatar

Stargazers

Ronnakorn Jannnalao avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.