{"id":16272959,"url":"https://github.com/jeroen/v8","last_synced_at":"2026-04-06T01:03:29.460Z","repository":{"id":23778785,"uuid":"27154014","full_name":"jeroen/V8","owner":"jeroen","description":"Embedded JavaScript Engine for R","archived":false,"fork":false,"pushed_at":"2024-06-07T16:21:06.000Z","size":150337,"stargazers_count":197,"open_issues_count":17,"forks_count":29,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-06-11T16:12:32.698Z","etag":null,"topics":["cran","javascript","libv8","r","wasm"],"latest_commit_sha":null,"homepage":"https://cran.r-project.org/package=V8","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeroen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-26T01:20:06.000Z","updated_at":"2024-06-21T17:29:28.376Z","dependencies_parsed_at":"2023-12-07T11:40:27.378Z","dependency_job_id":"099ac249-4905-4bf3-988c-4bc85bd4a8b7","html_url":"https://github.com/jeroen/V8","commit_stats":{"total_commits":563,"total_committers":12,"mean_commits":"46.916666666666664","dds":0.04262877442273538,"last_synced_commit":"3fb0f9ff84e5b1dbfacb223552ca1b0042d60deb"},"previous_names":["jeroenooms/v8"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroen%2FV8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroen%2FV8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroen%2FV8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroen%2FV8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeroen","download_url":"https://codeload.github.com/jeroen/V8/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451666,"owners_count":20940944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cran","javascript","libv8","r","wasm"],"created_at":"2024-10-10T18:20:34.953Z","updated_at":"2026-04-06T01:03:29.453Z","avatar_url":"https://github.com/jeroen.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# V8\n\n\u003e Embedded JavaScript and WebAssembly Engine for R\n\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/V8)](https://cran.r-project.org/package=V8)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/V8)](https://cran.r-project.org/web/packages/V8/index.html)\n\nAn R interface to V8: Google's open source JavaScript and WebAssembly \nengine. This package can be compiled either with V8 version 6 and up or NodeJS\nwhen built as a shared library.\n\n## Getting started\n\nAbout the R package:\n\n - Vignette: [Introduction to V8 for R](https://cran.r-project.org/web/packages/V8/vignettes/v8_intro.html)\n - Vignette: [Using NPM packages in V8 with browserify](https://cran.r-project.org/web/packages/V8/vignettes/npm.html)\n \nTo see some quick examples in R run:\n\n```r\nlibrary(V8)\nexample(v8)\n```\n\n## Installation\n \nBinary packages for __OS-X__ or __Windows__ can be installed directly from CRAN:\n\n```r\ninstall.packages(\"V8\")\n```\n\nOn Linux you need a suitable libv8 installation, see below.\n\n### Linux: Static libv8\n\nOn amd64/arm64 Linux/MacOS platforms it is possible (and recommended) to automatically download a suitable static build of libv8 during package installation. This is enabled by default on Ubuntu, RHEL, OpenSuse, Alpine, and MacOS. For other systems you can opt-in by setting an environment variable `DOWNLOAD_STATIC_LIBV8` during installation, for example:\n\n```r\nSys.setenv(DOWNLOAD_STATIC_LIBV8 = 1)\ninstall.packages(\"V8\")\n```\n\nThis way, you can install the R package on any x64 Linux system, without external system requirements. Alternatively, it is also still possible to install libv8 from your distribution as described below. This may be needed for servers running other architectures, or when building the R package without internet access.\n\n### Debian / Ubuntu\n\nInstallation from source on Linux requires [`libv8`](https://v8.dev/). On Ubuntu / Debian you need to install either [libv8-dev](https://packages.ubuntu.com/bionic/libv8-dev), or [libnode-dev](https://packages.ubuntu.com/eoan/libnode-dev). On the latest systems, `libv8-dev` is actually an alias for `libnode-dev` so they are the same:\n\n```sh\n# Debian and Ubuntu\nsudo apt-get install -y libv8-dev\n```\n\n### Fedora / Redhat\n\nOn __Fedora__ we need v8-devel (which Fedora provides as part of [nodejs](https://src.fedoraproject.org/rpms/nodejs)):\n\n```sh\nsudo yum install v8-devel\n````\n\nOn __CentOS 7 / RHEL 7__ we install first need to enable EPEL:\n\n```sh\nsudo yum install epel-release\nsudo yum install v8-devel\n```\n\nOn __RockyLinux 8 / RHEL 8__, `v8-devel` can be installed from the `nodejs:16-epel` module repository:\n\n```sh\nyum --refresh --enablerepo=epel-testing-modular install @nodejs:16-epel/minimal v8-devel\n```\n\n### Homebrew\n\nOn __OS-X__ use [v8](https://github.com/Homebrew/homebrew-core/blob/master/Formula/v8) from Homebrew:\n\n```sh\nbrew install v8\n```\n\nBut it is much easier to set `DOWNLOAD_STATIC_LIBV8` instead.\n\n\n## Hello World\n\n```r\n# Create a new context\nlibrary(V8)\nctx \u003c- v8()\n\n# Evaluate some code\nctx$eval(\"var foo = 123\")\nctx$eval(\"var bar = 456\")\nctx$eval(\"foo+bar\")\n\n# Assign / get objects\nctx$assign(\"foo\", JS(\"function(x){return x*x}\"))\nctx$assign(\"bar\", JS(\"foo(9)\"))\nctx$get(\"bar\")\n```\n\nCall functions from JavaScript libraries\n\n```r\nctx \u003c- V8::v8()\nctx$source(\"https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.4.0/coffee-script.min.js\")\njscode \u003c- ctx$call(\"CoffeeScript.compile\", \"square = (x) -\u003e x * x\", list(bare = TRUE))\nctx$eval(jscode)\nctx$call(\"square\", 9)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroen%2Fv8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeroen%2Fv8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroen%2Fv8/lists"}