{"id":15501472,"url":"https://github.com/devinus/execjs","last_synced_at":"2025-04-06T06:09:05.832Z","repository":{"id":11565017,"uuid":"14052231","full_name":"devinus/execjs","owner":"devinus","description":"Run JavaScript code from Elixir","archived":false,"fork":false,"pushed_at":"2018-08-13T05:29:45.000Z","size":49,"stargazers_count":152,"open_issues_count":7,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T05:05:30.793Z","etag":null,"topics":["elixir","javascipt"],"latest_commit_sha":null,"homepage":"https://github.com/devinus/execjs","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devinus.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}},"created_at":"2013-11-01T19:50:13.000Z","updated_at":"2024-11-30T17:29:58.000Z","dependencies_parsed_at":"2022-09-15T07:00:28.347Z","dependency_job_id":null,"html_url":"https://github.com/devinus/execjs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinus%2Fexecjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinus%2Fexecjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinus%2Fexecjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinus%2Fexecjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devinus","download_url":"https://codeload.github.com/devinus/execjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441052,"owners_count":20939239,"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":["elixir","javascipt"],"created_at":"2024-10-02T09:04:30.339Z","updated_at":"2025-04-06T06:09:05.812Z","avatar_url":"https://github.com/devinus.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Execjs\n\n[![Build Status](https://travis-ci.org/devinus/execjs.svg?branch=master)](https://travis-ci.org/devinus/execjs)\n[![Hex.pm Version](https://img.shields.io/hexpm/v/execjs.svg?style=flat-square)](https://hex.pm/packages/execjs)\n[![Hex.pm Download Total](https://img.shields.io/hexpm/dt/execjs.svg?style=flat-square)](https://hex.pm/packages/execjs)\n\n`Execjs` allows you easily run JavaScript from Elixir. It can automatically\npick the best runtime available on the system.\n\n## Runtimes\n\n`Execjs` supports the following runtimes:\n\n- [Node.js](https://nodejs.org/en/)\n- [V8](https://developers.google.com/v8/)\n- [SpiderMonkey](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey)\n- [JavaScriptCore](https://trac.webkit.org/wiki/JSC)\n- [Rhino](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino)\n\nUse the application environment (application key: `:execjs`, key: `:runtime`)\nto set the runtime `Execjs` uses. Alternatively, the `EXECJS_RUNTIME`\nenvironment variable can also be used to set the runtime.\n\n## Usage\n\n### `eval`\n\n```iex\niex\u003e \"'red yellow blue'.split(' ')\" |\u003e Execjs.eval\n[\"red\", \"yellow\", \"blue\"]\n```\n\n### `compile`/`call`\n\n```iex\niex\u003e {source, 0} = System.cmd(\"curl\", [\"-fsSL\", \"--compressed\", \"https://coffeescript.org/browser-compiler/coffeescript.js\"])\niex\u003e context = Execjs.compile(source)\niex\u003e Execjs.call(context, \"CoffeeScript.compile\", [\"square = (x) -\u003e x * x\"])\n\"(function() {\\n  var square;\\n\\n  square = function(x) {\\n    return x * x;\\n  };\\n\\n}).call(this);\\n\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinus%2Fexecjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevinus%2Fexecjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinus%2Fexecjs/lists"}