{"id":13546563,"url":"https://github.com/creationix/node-sdl","last_synced_at":"2025-10-06T11:01:59.196Z","repository":{"id":1557043,"uuid":"1953075","full_name":"creationix/node-sdl","owner":"creationix","description":"Minimal sdl bindings for maximum fun","archived":false,"fork":false,"pushed_at":"2014-12-06T18:38:20.000Z","size":4168,"stargazers_count":177,"open_issues_count":8,"forks_count":43,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-04T22:28:49.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/creationix.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}},"created_at":"2011-06-25T18:28:35.000Z","updated_at":"2025-07-27T05:43:17.000Z","dependencies_parsed_at":"2022-08-06T10:16:38.872Z","dependency_job_id":null,"html_url":"https://github.com/creationix/node-sdl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/creationix/node-sdl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-sdl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-sdl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-sdl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-sdl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creationix","download_url":"https://codeload.github.com/creationix/node-sdl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-sdl/sbom","scorecard":{"id":308126,"data":{"date":"2025-08-11","repo":{"name":"github.com/creationix/node-sdl","commit":"830ab42cbd9d39c70989a86182cb60351d7ef804"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Code-Review","score":0,"reason":"Found 1/18 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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 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"}}]},"last_synced_at":"2025-08-17T22:35:52.777Z","repository_id":1557043,"created_at":"2025-08-17T22:35:52.778Z","updated_at":"2025-08-17T22:35:52.778Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278598611,"owners_count":26013289,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":[],"created_at":"2024-08-01T12:00:40.245Z","updated_at":"2025-10-06T11:01:59.156Z","avatar_url":"https://github.com/creationix.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# node-sdl ( Simple DirectMedia Layer bindings for node.js )\n\n## 0. Installation\n\nCurrently, installation is finicky and largely depends upon my specific system for now. A future release is planned to make this process better. If you want to get it working, you need to have the dylibs mentioned in bindings.gyp under /usr/local/lib. (this includes the main SDL2 dylib, SDL2_ttf, and SDl2_image)\n\nIf you have those libraries, and clone node-sdl, you can build it with\n\n\u003cpre\u003e node-gyp configure build \u003c/pre\u003e\n\n## 1. Usage\n\nAs a general rule, these bindings adhere to the following conventions.\n\n* SDL structs are wrapped at the base level of the bindings. If you want a Window, it will be under sdl.Window.\n* Structs that you would normally pass to various functions are instead wrapped as objects with prototype functions, and are created with the new keyword. As an example, instead of doing something such as \u003cpre\u003esdl.GetWindowWidth(window)\u003c/pre\u003e, you would instead do \u003cpre\u003evar window = new sdl.Window(...); window.getWidth()\u003c/pre\u003e.\n* Constants, enums, etc. are split up into various namespaces below the base namespace, based on where the underscores are in their name. This roughly translates \u003cpre\u003eSDL_WINDOWPOS_CENTERED\u003c/pre\u003e into \u003cpre\u003esdl.WINDOWPOS.CENTERED\u003c/pre\u003e.\n* Extensions to the base SDL API are under their own namespace. While you would find \u003cpre\u003esdl.Window\u003c/pre\u003e or \u003cpre\u003esdl.Renderer\u003c/pre\u003e, anything under the SDL_ttf library would be under \u003cpre\u003esdl.TTF\u003c/pre\u003e If you want to make a font, you would use \u003cpre\u003enew sdl.TTF.Font\u003c/pre\u003e.\n\n## 2. Specific usage\n\n### 2.1 Initialization and Shutdown\n\nExplaining the basics behind finding pieces of the SDL API is all well and good, but examples are still the best. So here is a quick and easy way to create a new window using node-sdl.\n\n\u003cpre\u003esdl.init(sdl.INIT.EVERYTHING); // Initialize all SDL subsystems.\nvar window = new sdl.Window(\"Test Window\", sdl.WINDOWPOS.CENTERED, sdl.WINDOWPOS.CENTERED, 640, 480);\nsetTimeout(function() { sdl.quit(); }, 2000);\u003c/pre\u003e\n\nIt's that easy. Though one thing to be aware of: in that example I declared a window in the global space. Because that is the only place it is referenced, once the script finishes (meaning after the call to setTimeout) there will be no more references to it. That means the window will get garbage collected sometime in the future. And because the bindings handle destroying SDL objects when the wrapping object gets destructed, that means the window will disappear, seemingly randomly. Make sure you keep a reference to all objects you want to persist somewhere, or you might find your window disappearing without warning.\n\n### 2.2 Events\n\nCurrently, events are wrapped as a pure Javascript object. So trying to access properties of the event that don't exist for that event will give back undefined. You can determine the exact type of event by checking \u003cpre\u003eevent.type\u003c/pre\u003e just like in SDL. Same goes for all the other properties. If an event would have a key member, that will be in the Javascript object, etc.\n\n## 3. License\n\nCopyright (c) 2014 Tim \"creationix\" Caswell\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fnode-sdl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreationix%2Fnode-sdl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fnode-sdl/lists"}