{"id":19838988,"url":"https://github.com/objectionary/eo2js","last_synced_at":"2026-03-16T13:04:45.924Z","repository":{"id":239185996,"uuid":"798766850","full_name":"objectionary/eo2js","owner":"objectionary","description":"EOLANG to JavaScript transpiler and runtime","archived":false,"fork":false,"pushed_at":"2025-04-18T19:14:08.000Z","size":671,"stargazers_count":9,"open_issues_count":27,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T07:45:58.799Z","etag":null,"topics":["eolang","javascript","oop"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eo2js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/objectionary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-05-10T12:32:18.000Z","updated_at":"2025-04-12T02:29:09.000Z","dependencies_parsed_at":"2024-05-22T16:13:34.886Z","dependency_job_id":"f7b9e9e7-b664-4434-8561-fbbdcb7da5b9","html_url":"https://github.com/objectionary/eo2js","commit_stats":null,"previous_names":["maxonfjvipon/eo2js","objectionary/eo2js"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo2js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo2js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo2js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo2js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/objectionary","download_url":"https://codeload.github.com/objectionary/eo2js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924801,"owners_count":21666039,"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":["eolang","javascript","oop"],"created_at":"2024-11-12T12:19:50.379Z","updated_at":"2026-03-16T13:04:45.919Z","avatar_url":"https://github.com/objectionary.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eo2js\n\n\u003c!-- markdownlint-disable MD013 --\u003e\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n[![CI](https://github.com/objectionary/eo2js/actions/workflows/test.yml/badge.svg)](https://github.com/objectionary/eo2js/actions/workflows/test.yml)\n[![Hits-of-Code](https://hitsofcode.com/github/objectionary/eo2js)](https://hitsofcode.com/view/github/objectionary/eo2js)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.txt)\n\u003c!-- markdownlint-enable MD013 --\u003e\n\nCommand-line toolkit and runtime that takes **EO XMIR + `eo-foreign.json`**\n(usually in `.eoc/`) and turns them into a **Node.js project** you can run or\ntest. It does **not** read `.eo` directly — you must generate XMIR first.\n\n## EO version\n\nBuilt and tested with EO version `0.59.0`\n([eo2js/test/mvnw/eo-version.txt](https://github.com/objectionary/eo2js/blob/master/eo2js/test/mvnw/eo-version.txt)).\nUsing other versions may lead to unpredictable results.\n\n## Prerequisites\n\n- Node.js 20+ and npm\n- Java + Maven (if you generate XMIR via `eo-maven-plugin`; other EO toolchains\n  like `eoc` are fine too)\n\n## Install (CLI users)\n\n```bash\nnpm install -g eo2js\n```\n\n## Getting `.eoc` (XMIR + foreign)\n\nUse any EO toolchain to compile `.eo` into `.eoc`.\nExample with EO Maven plugin:\n\n```bash\nmvn org.eolang:eo-maven-plugin:register \\\n    org.eolang:eo-maven-plugin:parse \\\n    org.eolang:eo-maven-plugin:lint \\\n    -Deo.sourcesDir=src \\\n    -Deo.targetDir=.eoc \\\n    -Deo.failOnWarning=false\n```\n\nAfter that, `.eoc/eo-foreign.json` and XMIR files are ready for eo2js.\n\n## Core commands\n\n- `transpile` — convert XMIR from `eo-foreign.json` to JS under `\u003ctarget\u003e/\u003cproject\u003e`\n- `link` — build npm project (`package.json`, deps, `__main__.js`)\n- `dataize \u003cobject\u003e [args...]` — transpile+link (unless `--alone`) and run the\n  EO object\n- `test` — transpile+link (unless `--alone`) and run EO tests generated from\n  XMIR with `+tests`\n\nCommon options: `-t/--target` `.eoc` dir (default `.eoc`), `-p/--project`\nJS subdir (default `project`), `-f/--foreign` path to `eo-foreign.json`\n(default `eo-foreign.json` in target), `-r/--resources` path to eo2js resources\n(only needed when running from a clone), `-d/--dependency` path to local\n`eo2js-runtime`, `--alone` to skip automatic prerequisites.\n\n## Typical workflow (global install)\n\n```bash\n# After generating .eoc:\neo2js dataize org.eo2js.demo.main -t .eoc -p project\n\n# If transpile/link already done:\neo2js dataize org.eo2js.demo.main --alone -t .eoc -p project\n```\n\nIf you use the defaults (`.eoc` and `project`), you can omit `-t`/`-p`.\n\n## Minimal EO example\n\nCreate `hello/main.eo` (any folder name is fine):\n\n```eo\n+package hello\n+home https://example.com\n+version 0.1.0\n\n[] \u003e main\n  \"Hello from eo2js!\" \u003e @\n```\n\nCompile to `.eoc` from the folder where `hello/` lives:\n\n```bash\nmvn org.eolang:eo-maven-plugin:register \\\n    org.eolang:eo-maven-plugin:parse \\\n    org.eolang:eo-maven-plugin:lint \\\n    -Deo.sourcesDir=hello \\\n    -Deo.targetDir=.eoc \\\n    -Deo.failOnWarning=false\n```\n\nThen run via eo2js:\n\n```bash\neo2js dataize hello.main -t .eoc -p project\n```\n\n## From this repo without global install\n\n```bash\nNODE_PATH=eo2js/node_modules \\\nnode eo2js/src/eo2js.js dataize org.eo2js.demo.main \\\n  -t readme-demo/.eoc -p project \\\n  -r eo2js/src/resources \\\n  -d eo2js-runtime\n```\n\n(`-r`/`-d` point to local resources/runtime; omit if installed globally.)\n\n## How to Contribute\n\nFirst, run `npm install`. Then, run `npm test`. All tests should pass.\n\nMake your changes and then\n[make](https://www.yegor256.com/2014/04/15/github-guidelines.html)\na pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectionary%2Feo2js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjectionary%2Feo2js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectionary%2Feo2js/lists"}