Skip to content

Commit

Permalink
Add a README section on how to manually select runtimes
Browse files Browse the repository at this point in the history
Fix: #86
  • Loading branch information
byroot committed Sep 13, 2023
1 parent 4e31ac1 commit 1dfec33
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ 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 autodected one, you can assign `ExecJS.runtime`:

```ruby
ExecJS.runtime = ExecJS::Runtimes::Node
```

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

```bash
EXECJS_RUNTIME=Node ruby ...
```

You can find the list of possible runtimes in [`lib/execjs/runtimes.rb`](https://github.com/rails/execjs/blob/master/lib/execjs/runtimes.rb).

# Installation

```
Expand Down

0 comments on commit 1dfec33

Please sign in to comment.