{"id":18544713,"url":"https://github.com/131/node-winapi","last_synced_at":"2025-04-09T19:31:11.366Z","repository":{"id":3876581,"uuid":"51197646","full_name":"131/node-winapi","owner":"131","description":"Native windows api binding for nodejs","archived":false,"fork":false,"pushed_at":"2024-03-04T11:25:44.000Z","size":588,"stargazers_count":56,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-02T06:08:54.729Z","etag":null,"topics":["msdn","nodejs","screensaver","uptime","winapi"],"latest_commit_sha":null,"homepage":null,"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/131.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-06T10:00:57.000Z","updated_at":"2024-06-15T17:23:21.000Z","dependencies_parsed_at":"2024-03-04T12:42:17.105Z","dependency_job_id":"1a65d4ca-4286-4b43-9c11-94a0232d3d6d","html_url":"https://github.com/131/node-winapi","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fnode-winapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fnode-winapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fnode-winapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fnode-winapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/131","download_url":"https://codeload.github.com/131/node-winapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223407794,"owners_count":17140563,"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":["msdn","nodejs","screensaver","uptime","winapi"],"created_at":"2024-11-06T20:17:23.194Z","updated_at":"2024-11-06T20:17:23.767Z","avatar_url":"https://github.com/131.png","language":"C#","readme":"\n# winapi\nMisc natives MS Windows API wrappers for nodejs \u0026 nwjs\n\n[![Version](https://img.shields.io/npm/v/winapi.svg)](https://www.npmjs.com/package/winapi)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n[![Available platform](https://img.shields.io/badge/platform-nwjs-blue.svg)](https://www.npmjs.com/package/winapi) [![Available platform](https://img.shields.io/badge/platform-win32-blue.svg)](https://www.npmjs.com/package/winapi)\n[![Code style](https://img.shields.io/badge/code%2fstyle-ivs-green.svg)](https://www.npmjs.com/package/eslint-plugin-ivs)\n\n\n\n# API\n\n## require('winapi').getIdleTime()\nReturn the time the system has been idle (since last user interaction - e.g. mouse, keyboard \u0026 stuffs, see GetLastInputInfo)\nThis is really usefull if you want to create a screensaver/like in nodejs / node-webkit.\n\n```\nvar winapi = require('winapi');\n\nconsole.log(\"System is idle since %s\", winapi.getIdleTime() );\n\n```\n\n## require('winapi').CreateJobGroup()\nCreate a [job group](https://docs.microsoft.com/fr-fr/windows/desktop/ProcThread/job-objects) with current process and all future child_process. Use this to kill zombies. Like Rick.\n\n```\nvar winapi = require('winapi');\n\nwinapi.CreateJobGroup();\n\n//you can now spawn subprocess and they'll be killed once you died, windows will clean everything up\n\n```\n* (checkout my [dispatcher](https://github.com/131/dispatcher) project for inspiration)\n* Available for node 8, nw 26 and nw 14. (i did not re-compile other platform binaries, do it by yourself...)\n\n\n\n\n## require('winapi').GetLastInputInfo()\nUse this native binding to get system last input time ([see MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646302%28v=vs.85%29.aspx) )\n\n```\nvar winapi = require('winapi');\n\nconsole.log(\"Last input time is %s\", winapi.GetLastInputInfo() );\n\nsetTimeout(function(){\n  //do not move, it wont change !\n  console.log(\"Last input time is %s\", winapi.GetLastInputInfo() );\n}, 1000);\n\n```\n\n\n## require('winapi').GetChildrenProcess([parentProcessId])\nList all children process (of specified parent PID, default to current process)\n\n\n## require('winapi').GetParentProcess([childProcessId])\nGet a process parent PID (of specified process PID, default to current process)\n\n\n\n## require('winapi').GetTickCount()\nRetrieves the number of milliseconds that have elapsed since the system was started (uptime). ([see MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408%28v=vs.85%29.aspx) )\n\n### require('winapi').GetDisplaysList(console.log)\nList all connected screens\n\n# Credits\n* [131](mailto:131.js@cloudyks.org)\n* Code signing, courtesy of IVS Group.\n\n\n# Keywords / shout box\nscreensaver, windows api, winuser.h, GetLastInputInfo, activity monitor, inactivity trigger, idle timer, system uptime, sytem bootime\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fnode-winapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F131%2Fnode-winapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fnode-winapi/lists"}