R/onLoad.R

Defines functions .onLoad

#' @importFrom V8 new_context
ct <- NULL

.onLoad <- function(libname, pkgname){
  ct <<- new_context()
  libs <- list.files(system.file("js", package = pkgname), full.names = TRUE, pattern="*.js");
  lapply(sort(libs), function(path){
    ct$source(path)
  })
}

Try the js package in your browser

Any scripts or data that you put into this service are public.

js documentation built on July 2, 2020, 2:47 a.m.