{"id":51985920,"url":"https://github.com/node-3d/glfw","last_synced_at":"2026-07-30T19:01:37.079Z","repository":{"id":42351413,"uuid":"79730638","full_name":"node-3d/glfw","owner":"node-3d","description":"GLFW for Node.js","archived":false,"fork":false,"pushed_at":"2026-07-18T22:03:34.000Z","size":21725,"stargazers_count":62,"open_issues_count":0,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-07-19T00:06:22.109Z","etag":null,"topics":["addon","bindings","cpp","gl","glfw","graphics","javascript","native","node-3d","opengl","window"],"latest_commit_sha":null,"homepage":"https://github.com/node-3d/node-3d","language":"C++","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/node-3d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-01-22T16:50:38.000Z","updated_at":"2026-07-18T22:03:37.000Z","dependencies_parsed_at":"2023-02-07T02:16:55.859Z","dependency_job_id":"cc2d3e05-fdfe-48be-8605-992cfdc04f44","html_url":"https://github.com/node-3d/glfw","commit_stats":{"total_commits":438,"total_committers":24,"mean_commits":18.25,"dds":0.5684931506849316,"last_synced_commit":"52a82220fbcbeb8ed0882b4bd361420275544cd5"},"previous_names":["raub/node-glfw","node-3d/glfw"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/node-3d/glfw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fglfw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fglfw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fglfw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fglfw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-3d","download_url":"https://codeload.github.com/node-3d/glfw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2Fglfw/sbom","scorecard":{"id":691780,"data":{"date":"2025-08-11","repo":{"name":"github.com/node-3d/glfw-raub","commit":"f43fd6a630f8f3c4f60344c8150c970337b15a70"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/cpplint.yml:1","Warn: no topLevel permission defined: .github/workflows/eslint.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cpplint.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/cpplint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cpplint.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/cpplint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/eslint.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/eslint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/eslint.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/eslint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/node-3d/glfw-raub/test.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/cpplint.yml:37","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   4 out of   4 npmCommand dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 6.4.0 not signed: https://api.github.com/repos/node-3d/glfw-raub/releases/202491505","Warn: release artifact 6.1.0 not signed: https://api.github.com/repos/node-3d/glfw-raub/releases/193228740","Warn: release artifact 6.0.0 not signed: https://api.github.com/repos/node-3d/glfw-raub/releases/183223209","Warn: release artifact 6.4.0 does not have provenance: https://api.github.com/repos/node-3d/glfw-raub/releases/202491505","Warn: release artifact 6.1.0 does not have provenance: https://api.github.com/repos/node-3d/glfw-raub/releases/193228740","Warn: release artifact 6.0.0 does not have provenance: https://api.github.com/repos/node-3d/glfw-raub/releases/183223209"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T02:28:28.264Z","repository_id":42351413,"created_at":"2025-08-22T02:28:28.265Z","updated_at":"2025-08-22T02:28:28.265Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36088336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-30T02:00:05.956Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["addon","bindings","cpp","gl","glfw","graphics","javascript","native","node-3d","opengl","window"],"created_at":"2026-07-30T19:01:36.460Z","updated_at":"2026-07-30T19:01:37.061Z","avatar_url":"https://github.com/node-3d.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GLFW for Node.js\n\nThis is a part of [Node3D](https://github.com/node-3d) project.\n\n[![NPM](https://badge.fury.io/js/@node-3d%2Fglfw.svg)](https://badge.fury.io/js/@node-3d%2Fglfw)\n[![Lint](https://github.com/node-3d/glfw/actions/workflows/lint.yml/badge.svg)](https://github.com/node-3d/glfw/actions/workflows/lint.yml)\n[![Test](https://github.com/node-3d/glfw/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/glfw/actions/workflows/test.yml)\n[![Cpplint](https://github.com/node-3d/glfw/actions/workflows/cpplint.yml/badge.svg)](https://github.com/node-3d/glfw/actions/workflows/cpplint.yml)\n\n```bash\nnpm install @node-3d/glfw\n```\n\n**Node.js** addon with **GLFW3** bindings.\n\n![Example](examples/screenshot.jpg)\n\n* **GLFW** version **3.4.0** backend.\n* Exposes low-level **GLFW** interface.\n* Multiple windows for a single **Node.js** process.\n* Able to switch to fullscreen and back.\n* Provides `GlfwWindow`, a native GLFW window wrapper for direct window/control work.\n* Keeps legacy `Window` and `Document` classes for compatibility with older code.\n* Leaves browser-like `Window`/`Document`/canvas behavior to\n  [@node-3d/core](https://github.com/node-3d/core).\n\nThe package has named exports only. Use `glfw` for the raw native bindings,\nand import `GlfwWindow` directly for native window management.\n\n```ts\nimport { GlfwWindow, glfw } from '@node-3d/glfw';\n\nconst wnd = new GlfwWindow({ title: 'GLFW Test', vsync: true });\n\nwnd.loop(() =\u003e {\n\tif (wnd.shouldClose || wnd.getKey(glfw.KEY_ESCAPE)) {\n\t\tprocess.exit(0);\n\t\treturn;\n\t}\n\t\n\tglfw.testScene(wnd.width, wnd.height);\n});\n```\n\n\u003e Note: this **addon uses N-API**, and therefore is ABI-compatible across different\nNode.js versions. Addon binaries are precompiled and **there is no compilation**\nstep during the `npm install` command.\n\nPrebuilt addon binaries are provided for Windows x64/ARM64, Linux x64/ARM64,\nand macOS x64/ARM64.\n\n## Concern Separation\n\n`@node-3d/glfw` is the GLFW layer:\n\n* `glfw` exposes the raw native GLFW binding and constants.\n* `GlfwWindow` wraps a native GLFW window handle with event, size, mode, context,\n  frame, and loop helpers.\n* `Window` and `Document` remain as legacy compatibility classes.\n\nBrowser-style application compatibility belongs in `@node-3d/core`:\n\n* `BrowserWindow` owns browser-style `requestAnimationFrame`.\n* `BrowserDocument` owns document/canvas/image/WebGL compatibility.\n* `init()` wires `globalThis.window`, `globalThis.document`, WebGL, Image, and\n  other browser-like globals.\n\n## GLFW\n\nThis is a low-level interface, where most of the stuff is directly reflecting\nGLFW API. GLFW **does NOT EXPOSE** OpenGL commands, it only [controls the window-related\nsetup and resources](http://www.glfw.org/docs/latest/group__window.html).\nTo access OpenGL/WebGL API you can use [@node-3d/webgl](https://github.com/node-3d/webgl)\nor any other similar addon.\n\nAside from several additional features, this addon directly exposes the GLFW API to JS. E.g.:\n\n```cpp\nDBG_EXPORT JS_METHOD(pollEvents) {\n\tglfwPollEvents();\n\tRET_GLFW_VOID;\n}\n```\n\nNothing is added between you and GLFW, unless necessary or explicitly mentioned.\n\n* All `glfw*` functions are accessible as\n    `glfw.*`. E.g. `glfwPollEvents` -\u003e `glfw.pollEvents`.\n* All `GLFW_*` constants are accessible as\n    `glfw.*`. E.g. `GLFW_TRUE` -\u003e `glfw.TRUE`.\n* Higher-level helpers are separate named exports.\n    E.g. `import { GlfwWindow } from '@node-3d/glfw'`.\n* Method `glfw.createWindow` takes some additional arguments. This is mostly related to\n    JS events being generated from GLFW callbacks,\n    and here's where you provide an Emitter object.\n* Pointers are directly exposed as numbers to JS and are expected as\n    arguments in specific methods. Such as, `glfw.createWindow` returns a number\n    (pointer), and then you provide it back to e.g. `glfw.setWindowTitle`.\n\nSee [this example](examples/vulkan.ts) for raw GLFW calls.\n\nThe public entrypoint exports `glfw`, `GlfwWindow`, legacy `Window`, legacy\n`Document`, and event/window option types. The lower-level raw API is on `glfw`;\nthe classes are imported directly.\n\n----------\n\n\n### class GlfwWindow\n\n```ts\nimport { GlfwWindow } from '@node-3d/glfw';\n\nconst wnd = new GlfwWindow({ title: 'GLFW Test', vsync: true });\n```\n\nThis class manages native window objects and their events. It can also switch between\nfullscreen, borderless and windowed modes. It does not implement browser\n`requestAnimationFrame` or document/canvas compatibility.\n\nThe first window creates an additional invisible root-window for context sharing\n(so that you can also close any window and still keep the root context).\nThe platform context (pointers/handles) for sharing may be obtained when necessary.\n\nSee [`ts/window.ts`](ts/window.ts) for more details.\n\nLegacy `Window` remains available as a subclass with `requestAnimationFrame` and\n`cancelAnimationFrame`. New browser-style code should use `BrowserWindow` from\n`@node-3d/core`.\n\n----------\n\n### Legacy class Document\n\n```ts\nimport { Document } from '@node-3d/glfw';\n\nconst doc = new Document({ title: 'GLFW Test', vsync: true });\n```\n\nDocument inherits from legacy `Window` and has the same features in general.\nIt exposes additional APIs to mimic the content of web `document`.\nThere are some tricks to provide WebGL libraries with necessary environment.\nDocument is kept for compatibility; new browser-style code should use\n`BrowserDocument` from `@node-3d/core`.\nOther web libraries may work too, but may require additional tweaking.\n\nSee [`ts/document.ts`](ts/document.ts) for more details.\n\n----------\n\n### Extras\n\n* `glfw.hideConsole(): void` - tries to hide the console window on Windows.\n* `glfw.showConsole(): void` - shows the console window if it has been hidden.\n* `glfw.drawWindow(w: number, cb: (timestamp: number) =\u003e void): void` - this is a shortcut\n    to call `pollEvents`, then `cb`, and then `swapBuffers`. `GlfwWindow#drawWindow`\n    wraps this call and supplies the window handle for you.\n* `glfw.platformDevice(): number` - returns the native display or device handle,\n    or whatever is similar on other systems.\n* `glfw.platformWindow(w: number): number` - returns the window HWND on Windows,\n    or whatever is similar on other systems.\n* `glfw.platformContext(w: number): number` - returns the window WGL Context on Windows,\n    or whatever is similar on other systems.\n\n## Binary Origin\n\nRelease archives are built by this repository's public GitHub Actions workflows.\n\nAttestations: https://github.com/node-3d/glfw/attestations\n\nTo verify a downloaded archive:\n\n```bash\ngh release download \u003ctag\u003e -R node-3d/glfw -p \u003cplatform\u003e.gz\ngh attestation verify \u003cplatform\u003e.gz -R node-3d/glfw\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2Fglfw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-3d%2Fglfw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2Fglfw/lists"}