A summary of data about the Ruby ecosystem.

https://github.com/rails/execjs

Run JavaScript code from Ruby
https://github.com/rails/execjs

Keywords from Contributors

rubygems activerecord mvc activejob rack ruby-gem sinatra rspec background-jobs libxml2

Last synced: about 21 hours ago
JSON representation

Repository metadata

Run JavaScript code from Ruby

README.md

ExecJS

ExecJS lets you run JavaScript code from Ruby. It automatically picks
the best runtime available to evaluate your JavaScript program, then
returns the result to you as a Ruby object.

ExecJS supports these runtimes:

A short example:

require "execjs"
ExecJS.eval "'red yellow blue'.split(' ')"
# => ["red", "yellow", "blue"]

A longer example, demonstrating how to invoke the CoffeeScript compiler:

require "execjs"
require "net/http"
source = Net::HTTP.get(URI("https://coffeescript.org/browser-compiler-legacy/coffeescript.js"))

context = ExecJS.compile(source)
context.call("CoffeeScript.compile", "square = (x) -> x * x", bare: true)
# => "var square;\nsquare = function(x) {\n  return x * x;\n};"

Forcing a specific runtime

If you'd like to use a specific runtime rather than the autodetected one, you can assign ExecJS.runtime:

ExecJS.runtime = ExecJS::Runtimes::Node

Alternatively, you can define it via the EXECJS_RUNTIME environment variable:

EXECJS_RUNTIME=Node ruby ...

You can find the list of possible runtimes in lib/execjs/runtimes.rb.

Installation

$ gem install execjs

FAQ

Why can't I use CommonJS require() inside ExecJS?

ExecJS provides the lowest common denominator interface to any JavaScript runtime.
Use ExecJS when it doesn't matter which JavaScript interpreter your code runs
in. If you want to access the Node API, you should check another library like
commonjs.rb designed to provide a
consistent interface.

Why can't I use setTimeout?

For similar reasons as modules, not all runtimes guarantee a full JavaScript
event loop. So setTimeout, setInterval and other timers are not defined.

Why can't I use ES5 features?

Some runtimes like Node will implement many of the latest ES5 features. However
older stock runtimes like JSC on OSX and JScript on Windows may not. You should
only count on ES3 features being available. Prefer feature checking these APIs
rather than hard coding support for specific runtimes.

Can ExecJS be used to sandbox scripts?

No, ExecJS shouldn't be used for any security related sandboxing. Since runtimes
are automatically detected, each runtime has different sandboxing properties.
You shouldn't use ExecJS.eval on any inputs you wouldn't feel comfortable Ruby
eval()ing.

Contributing to ExecJS

ExecJS is the work of dozens of contributors. You're encouraged to submit pull requests, propose
features and discuss issues.

See CONTRIBUTING.

License

ExecJS is released under the MIT License.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 414
Total Committers: 58
Avg Commits per committer: 7.138
Development Distribution Score (DDS): 0.449

Commits in past year: 1
Committers in past year: 1
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Joshua Peek j****h@j****m 228
Sam Stephenson s****m@3****m 47
Jean Boussier j****r@g****m 23
Benoit Daloze e****p@g****m 15
Rafael Mendonça França r****a@g****m 8
stereobooster s****r@g****m 7
Ryunosuke SATO t****s@g****m 5
Magnus Holm j****r@g****m 5
Akira Matsuda r****e@d****p 5
Erik Michaels-Ober s****k@g****m 4
Sam s****n@g****m 3
Aaron Patterson a****n@g****m 3
Peter Wagenet p****t@g****m 2
Nicholas D. Wolfwood b****e@g****g 2
Matt Burke s****s@g****m 2
Luis Lavena l****a@g****m 2
Jun Aruga j****a@r****m 2
Stephen Waits s****e@w****t 2
Sébastien Gaya s****a@g****m 2
m-nakamura145 m****5@g****m 2
Ville Lautanala l****s@g****m 2
Jason Meller j****n@k****o 2
Guillermo Iguaran g****n@g****m 2
Darío Hereñú m****a@g****m 2
Bruno Aguirre yo@b****m 2
Benjamin p****n 2
Andrew White a****e@u****o 2
Todd Fisher t****r@l****m 1
Reese Armstrong r****e@o****g 1
Marcus Brito m****o@e****r 1
and 28 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 25 days ago

Total issues: 68
Total pull requests: 60
Average time to close issues: 5 months
Average time to close pull requests: 5 months
Total issue authors: 67
Total pull request authors: 36
Average comments per issue: 3.15
Average comments per pull request: 2.18
Merged pull request: 42
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 3
Past year average time to close issues: N/A
Past year average time to close pull requests: about 11 hours
Past year issue authors: 0
Past year pull request authors: 2
Past year average comments per issue: 0
Past year average comments per pull request: 0.67
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/rails/execjs

Top Issue Authors

  • Schwad (2)
  • SamSaffron (1)
  • theo-bittencourt (1)
  • connorshea (1)
  • SuwakoMmh (1)
  • saghoshprogress (1)
  • rafalpetryka (1)
  • jrafanie (1)
  • maisumakun (1)
  • yagarea (1)
  • blaccout47 (1)
  • mpz (1)
  • Nerian (1)
  • AlZero-t (1)
  • 1026cy (1)

Top Pull Request Authors

  • eregon (7)
  • tricknotes (3)
  • junaruga (3)
  • m-nakamura145 (3)
  • amatsuda (3)
  • casperisfine (3)
  • byroot (2)
  • tomocrafter (2)
  • SebouChu (2)
  • SamSaffron (2)
  • viralpraxis (2)
  • kuyseng (2)
  • mattmenefee (2)
  • josh (2)
  • paulmakepeace (1)

Top Issue Labels

Top Pull Request Labels


Package metadata

gem.coop: execjs

ExecJS lets you run JavaScript code from Ruby.

rubygems.org: execjs

ExecJS lets you run JavaScript code from Ruby.

proxy.golang.org: github.com/rails/execjs

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/rails/execjs#section-documentation
  • Licenses: mit
  • Latest release: v2.10.0+incompatible (published over 1 year ago)
  • Last Synced: 2026-03-02T02:27:22.624Z (1 day ago)
  • Versions: 53
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Forks count: 1.61%
    • Stargazers count: 2.674%
    • Average: 6.165%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
conda-forge.org: rb-execjs

  • Homepage: https://rubygems.org/gems/execjs
  • Licenses: MIT
  • Latest release: 2.7.0 (published over 6 years ago)
  • Last Synced: 2026-02-03T04:50:32.953Z (28 days ago)
  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Rankings:
    • Forks count: 10.305%
    • Stargazers count: 18.115%
    • Average: 20.434%
    • Dependent repos count: 24.343%
    • Dependent packages count: 28.974%
debian-10: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Documentation: https://packages.debian.org/buster/ruby-execjs
  • Licenses:
  • Latest release: 2.6.0-1 (published 20 days ago)
  • Last Synced: 2026-02-13T04:21:07.223Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.04: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Licenses:
  • Latest release: 2.8.1-2 (published 25 days ago)
  • Last Synced: 2026-02-06T15:08:45.875Z (25 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
ubuntu-23.04: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Licenses:
  • Latest release: 2.8.1-1 (published 20 days ago)
  • Last Synced: 2026-02-11T06:38:59.315Z (20 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-20.04: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Licenses:
  • Latest release: 2.6.0-1 (published 18 days ago)
  • Last Synced: 2026-02-13T07:13:09.121Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.10: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Licenses:
  • Latest release: 2.8.1-1 (published 18 days ago)
  • Last Synced: 2026-02-13T18:19:26.462Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.10: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Licenses:
  • Latest release: 2.8.1-2 (published 22 days ago)
  • Last Synced: 2026-02-09T16:31:17.066Z (22 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
debian-11: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Documentation: https://packages.debian.org/bullseye/ruby-execjs
  • Licenses:
  • Latest release: 2.7.0-1 (published 20 days ago)
  • Last Synced: 2026-02-13T08:20:03.033Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Documentation: https://packages.debian.org/bookworm/ruby-execjs
  • Licenses:
  • Latest release: 2.8.1-1 (published 18 days ago)
  • Last Synced: 2026-02-12T23:28:52.106Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-22.04: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Licenses:
  • Latest release: 2.8.1-1 (published 18 days ago)
  • Last Synced: 2026-02-13T13:16:22.112Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-13: ruby-execjs

  • Homepage: https://github.com/rails/execjs
  • Documentation: https://packages.debian.org/trixie/ruby-execjs
  • Licenses:
  • Latest release: 2.8.1-2 (published 19 days ago)
  • Last Synced: 2026-02-13T13:15:08.664Z (18 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • ruby/setup-ruby v1 composite
Gemfile rubygems
  • duktape >= 0 development
  • mini_racer >= 0 development
  • minitest >= 0 development
  • therubyrhino >= 1.73.3 development
execjs.gemspec rubygems
  • rake >= 0 development

Score: 31.984820654484423