R/zzz.r

Defines functions .onLoad

.pkgenv <- new.env(parent=emptyenv())

.onLoad <- function(...) {

  ctx <- v8()
  ctx$source(system.file("js/bundle.js", package="uaparserjs"))
  ctx$eval(JS('var parser = uap(regexes)'))

  assign("ctx", ctx, envir=.pkgenv)

  cache <- list()

  assign("cache", cache, envir=.pkgenv)

}

Try the uaparserjs package in your browser

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

uaparserjs documentation built on July 1, 2020, 5:38 p.m.