{"id":13782640,"url":"https://github.com/juhana/hugojs","last_synced_at":"2026-01-19T00:37:54.617Z","repository":{"id":140662745,"uuid":"74503104","full_name":"juhana/hugojs","owner":"juhana","description":"HugoJS online Hugo interpreter","archived":false,"fork":false,"pushed_at":"2022-04-26T18:59:45.000Z","size":1004,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-17T17:43:31.926Z","etag":null,"topics":["interactive-fiction","interpreter"],"latest_commit_sha":null,"homepage":"http://textadventures.online","language":"C","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/juhana.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}},"created_at":"2016-11-22T18:47:07.000Z","updated_at":"2024-09-21T08:30:33.000Z","dependencies_parsed_at":"2023-04-15T14:35:10.264Z","dependency_job_id":null,"html_url":"https://github.com/juhana/hugojs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juhana%2Fhugojs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juhana%2Fhugojs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juhana%2Fhugojs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juhana%2Fhugojs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juhana","download_url":"https://codeload.github.com/juhana/hugojs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253595477,"owners_count":21933394,"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":["interactive-fiction","interpreter"],"created_at":"2024-08-03T18:01:40.566Z","updated_at":"2026-01-19T00:37:54.587Z","avatar_url":"https://github.com/juhana.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# HugoJS – Online Hugo Interpreter\n\nHugoJS is an online interpreter for [Hugo](http://ifwiki.org/index.php/Hugo) games.\n\nThe interpreter is running at [textadventures.online](http://textadventures.online).\n\nIf you want to host the interpreter on your own web site, see [Hosting your own interpreter instance](../../wiki/Hosting-your-own-interpreter-instance).\n\nFor more documentation, see the [wiki pages](../../wiki).\n\n\n## Development Environment\n\n### Installation\n\nThe build scripts are made for a Unix environment (Linux/MacOS). To use them you need [npm](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/). npm comes with a standard [Node.js](https://nodejs.org) installation. `npm install` (or `yarn install`) installs [Webpack](https://webpack.js.org/) that builds the final package.\n\nAlternatively you can download the engine files from the online interpreter instance: [he.js](http://hugo.caltrops.com/play/he.js) and [he.wasm](http://hugo.caltrops.com/play/he.wasm). Place the files into the assets directory.\n\n### Dev server\n\nRun `npm start` (or `yarn start`) to start the development server on localhost:8080. The server automatically reloads the page when you make changes to the source files. Ctrl+C stops the server.\n\nUse the URL http://localhost:8080/play/index.html to access the interpreter.\n\nThe development server serves any files found in a directory called \"library\" in the root of the project. If you create that directory and put test story files there, you can run them using the URL http://localhost:8080/play/index.html?story=/story.hex where \"story.hex\" is the name of the story file. Note that the leading `/` character is required.\n\n\n## C Engine\n\nThe interpreter engine itself is the official Hugo interpreter engine that has been compiled from C to JavaScript with [Emscripten](http://emscripten.org/).\n\nIn the repository's \"he\" directory [hejs.c](he/hejs.c) contains most of HugoJS-specific C code. It's mainly responsible for communication between the engine and the user interface. C project setup is at the start of [heheader.h](he/heheader.h). There are other minor changes here and there in other C files. The changes are contained in `#if defined __EMSCRIPTEN__` directives.\n\nIf you make changes to the C interpreter, you need to run the `npm run compile` (or `yarn compile`) command to regenerate the JS files using a [Docker](https://docker.com) image that has Emscripten pre-installed. You need to first install Docker to do this.\n\n\n## User Interface\n\nThe JavaScript user interface sources are in the src directory.\n\n* index.js: loads the necessary files and bootstraps the system\n* hugo.js: HugoJS-specific code\n* opcodes.js: special community-extended Hugo opcodes\n\n[Haven](https://github.com/vorple/haven) is the actual JavaScript interpreter that handles the game output. It's included as a git submodule.\n\n\n## Development Scripts\n\nThe command `npm start` (or `yarn start`) starts Webpack in watch mode (recompiles every time source files change.) \n\nTo build the project for deployment use `npm run build` (or `yarn build`). Webpack creates a directory called \"dist\" where it copies necessary files and minifies the scripts. The build script creates a hugojs.zip package of the files for deployment. \n\n`npm run compile` (or `yarn compile`) compiles the C interpreter into JavaScript.\n\n`npm run lint` (or `yarn lint`) runs the source files through [ESLint](https://eslint.org) and checks that the coding style is consistent.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuhana%2Fhugojs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuhana%2Fhugojs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuhana%2Fhugojs/lists"}