{"id":16187030,"url":"https://github.com/robloach/node-raylib","last_synced_at":"2025-04-05T14:09:57.032Z","repository":{"id":34931636,"uuid":"164070439","full_name":"RobLoach/node-raylib","owner":"RobLoach","description":"Node.js bindings for Raylib","archived":false,"fork":false,"pushed_at":"2023-11-20T04:57:51.000Z","size":29806,"stargazers_count":229,"open_issues_count":52,"forks_count":20,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-05-03T02:14:10.524Z","etag":null,"topics":["nodejs","raylib"],"latest_commit_sha":null,"homepage":"https://robloach.github.io/node-raylib/","language":"JavaScript","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/RobLoach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-01-04T06:56:57.000Z","updated_at":"2024-06-18T22:50:22.351Z","dependencies_parsed_at":"2024-06-18T22:50:06.970Z","dependency_job_id":"30b9ac0c-6c37-4972-8461-640719e0d5aa","html_url":"https://github.com/RobLoach/node-raylib","commit_stats":{"total_commits":360,"total_committers":10,"mean_commits":36.0,"dds":0.4277777777777778,"last_synced_commit":"14622a84b48bc2bb25b335a14d92b2f4effe5d46"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fnode-raylib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fnode-raylib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fnode-raylib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fnode-raylib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLoach","download_url":"https://codeload.github.com/RobLoach/node-raylib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345856,"owners_count":20924102,"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":["nodejs","raylib"],"created_at":"2024-10-10T07:20:04.792Z","updated_at":"2025-04-05T14:09:57.013Z","avatar_url":"https://github.com/RobLoach.png","language":"JavaScript","readme":"![node-raylib Logo](logo/raylib-node_256x256.png)\n\n# node-raylib [![npm version](http://img.shields.io/npm/v/raylib.svg)](https://npmjs.org/package/raylib \"View this project on npm\") [![Tests](https://github.com/RobLoach/node-raylib/actions/workflows/test.yml/badge.svg)](https://github.com/RobLoach/node-raylib/actions/workflows/test.yml \"See automated test status on GitHub Actions\")\n\n[Node.js](https://nodejs.org) bindings for [raylib](https://www.raylib.com/), a simple and easy-to-use library to enjoy videogames programming (www.raylib.com).\n\n## Examples\n\n| Name | Description | Author |\n|:-----|:------------|:-------|\n| [Offical Examples](examples) | Ports of raylib's examples to node-raylib | [@RobLoach](https://github.com/robloach), [@twunky](https://github.com/twuky), [@konsumer](https://github.com/konsumer) |\n| [Flappy](https://github.com/arthurmassanes/flappy) | A [Flappy Bird](https://en.wikipedia.org/wiki/Flappy_Bird) clone | [@arthurmassanes](https://github.com/arthurmassanes) |\n| [Retro RPG Template](https://github.com/notnullgames/raylib-example-retro_rpg) | Small prototype to build a retro-inspired RPG game | [@konsumer](https://github.com/konsumer) |\n| [Chip8](https://github.com/taniarascia/chip8) | A [CHIP-8](https://en.wikipedia.org/wiki/CHIP-8) emulator whose native client using node-raylib | [@taniarascia](https://github.com/taniarascia) |\n\n## Dependencies\n\n- [Node.js](https://nodejs.org) \u003e= 10\n\n## Usage\n\n1. Create a new Node.js project:\n    ``` bash\n    mkdir myexample\n    cd myexample\n    ```\n\n2. Create a `package.json` file with:\n    ``` json\n    {\n      \"dependencies\": {\n        \"raylib\": \"*\"\n      },\n      \"scripts\": {\n          \"start\": \"node index.js\"\n      }\n    }\n    ```\n\n3. Create a `index.js` JavaScript file, like [`core_basic_window.js`](examples/core/core_basic_window.js):\n    ``` javascript\n    const r = require('raylib')\n\n    const screenWidth = 800\n    const screenHeight = 450\n    r.InitWindow(screenWidth, screenHeight, \"raylib [core] example - basic window\")\n    r.SetTargetFPS(60)\n\n    while (!r.WindowShouldClose()) {\n        r.BeginDrawing();\n        r.ClearBackground(r.RAYWHITE)\n        r.DrawText(\"Congrats! You created your first node-raylib window!\", 120, 200, 20, r.LIGHTGRAY)\n        r.EndDrawing()\n    }\n    r.CloseWindow()\n    ```\n\n4. Have npm install the dependencies for you:\n    ``` bash\n    npm install\n    ```\n\n5. Run `index.js` through Node.js:\n    ``` bash\n    npm start\n    ```\n    ![Screenshot](examples/core/core_basic_window.png)\n\nCheck for more [examples](examples) organized by raylib modules.\n\n## Installation\n\nRaylib is implemented as bindings with [node-addon-api](https://github.com/nodejs/node-addon-api). Bindings are prebuilt for many platforms in [Releases](https://github.com/RobLoach/node-raylib/releases). If your platform is not supported by a prebuilt binary, you will need CMake to build the native addon. Windows users building manually will also require MSVC Build Tools 2019, or Visual Studio 2019 with build tools for C/C++.\n\nIn general, to install node-raylib locally, use [npm](https://www.npmjs.com/):\n```\nnpm install raylib\n```\n\n## DRM\nOn some ARM devices like Raspberry PI, raylib can be used in a DRM mode instead of rendering to an x11 window. This version requires a seperate\nnative addon, and on installation on ARM devices node-raylib will include both. To use the DRM mode, import `raylib/drm` instead.\n```js\nimport * as rl from 'raylib/drm/index.js'\nconst rl = require('raylib/drm')\n```\n\n### CLI\n\nThe project comes with a [`node-raylib`](https://github.com/RobLoach/node-raylib/blob/master/bin/node-raylib) command-line tool to run `node-raylib` files directly:\n\n``` bash\n# Unix\n./bin/node-raylib core_basic_window.js\n\n# Windows\nnode bin/node-raylib core_basic_window.js\n```\n\nThe CLI can be installed globally through `npm` or `npx` for no-install:\n\n``` bash\nnpm install raylib --global\nnode-raylib --version\nnpx -y raylib --version\n```\n\n## Development\n\n[node-addon-api](https://github.com/nodejs/node-addon-api) is used to construct the bindings. Raylib provides a header parser that generates a JSON file containing information on the API. The code binding raylib to NodeJS is automatically generated based on this file. For information on how bindings are written for raylib read the [documentation](docs). Code generators for the C++ bindings, TypeScript definitions, and JavaScript wrapper functions are found in the [tools/generate_templates folder](tools/generate_templates).\n\n### Testing\nRun the following to run tests...\n\n```\ngit clone https://github.com/RobLoach/node-raylib.git\ncd node-raylib\nnpm i\nnpm t\n```\n\n### TypeScript Definitions\n\nTypescript definitions are provided by a generator based on raylib's header parser. See [node-raylib-definitions.js](tools/generate_templates/node-raylib-definitions.js) for information on how to generate them.\n\n### Package\n\nTo build the packaged releases, use the following command:\n\n```\nnpm run pkg\n```\n\n## License\n\n*node-raylib* is licensed under an unmodified zlib/libpng license, which is an OSI-certified,\nBSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.\n\n*Copyright (c) 2022 Rob Loach ([@RobLoach](https://twitter.com/RobLoach))*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fnode-raylib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobloach%2Fnode-raylib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fnode-raylib/lists"}