knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

tinyjs - Lightweight Embedded JavaScript Engine (a wrapper for TinyJS)

An R interface to the 'TinyJS' — https://github.com/gfwilliams/tiny-js — JavaScript engine; a more lightweight alternative to 'V8' with no external dependencies.

The following functions are implemented:

The following data sets are included:

News

Installation

devtools::install_github("hrbrmstr/tinyjs")
options(width=120)

Usage

library(tinyjs)

# current verison
packageVersion("tinyjs")

eval_js("var a=10;")
js_get("a")

eval_js("var b={this:'that', or:4, the:['ot', 'he', 'r']};")
js_get("b")

for(js_fil in sprintf("js/test00%d.js", 1:7)) {
  source_js(system.file(js_fil, package="tinyjs"))
  print(js_get("result"))
}

Test Results

library(tinyjs)
library(testthat)

date()

test_dir("tests/")

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



hrbrmstr/tinyjs documentation built on May 17, 2019, 5:36 p.m.