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)
  })
}
jeroenooms/js documentation built on June 6, 2020, 4:15 p.m.