{"id":21157092,"url":"https://github.com/zagrios/regedit-rs","last_synced_at":"2025-07-09T12:32:58.052Z","repository":{"id":211660984,"uuid":"724856702","full_name":"Zagrios/regedit-rs","owner":"Zagrios","description":"A high-performance Windows registry toolkit, powered by Rust with napi-rs","archived":false,"fork":false,"pushed_at":"2024-03-20T12:58:49.000Z","size":1142,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-08T05:46:05.851Z","etag":null,"topics":["napi-rs","nodejs","regedit","registry","rust","typescript","windows"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/regedit-rs","language":"JavaScript","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/Zagrios.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}},"created_at":"2023-11-28T23:41:23.000Z","updated_at":"2024-11-02T05:38:07.000Z","dependencies_parsed_at":"2024-03-20T14:08:15.326Z","dependency_job_id":null,"html_url":"https://github.com/Zagrios/regedit-rs","commit_stats":null,"previous_names":["zagrios/regedit-rs"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zagrios%2Fregedit-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zagrios%2Fregedit-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zagrios%2Fregedit-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zagrios%2Fregedit-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zagrios","download_url":"https://codeload.github.com/Zagrios/regedit-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225544705,"owners_count":17486159,"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":["napi-rs","nodejs","regedit","registry","rust","typescript","windows"],"created_at":"2024-11-20T12:00:07.008Z","updated_at":"2024-11-20T12:00:07.910Z","avatar_url":"https://github.com/Zagrios.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# regedit-rs\n\n\u003ca href=\"https://github.com/Zagrios/regedit-rs/actions\"\u003e\u003cimg alt=\"GitHub CI Status\" src=\"https://github.com/Zagrios/regedit-rs/workflows/CI/badge.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/regedit-rs\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/regedit-rs.svg?sanitize=true\" alt=\"regedit-rs npm version\"\u003e\u003c/a\u003e\n[![Rust 1.70+](https://img.shields.io/badge/rust-1.70+-orange.svg)](https://www.rust-lang.org)\n\nA high-performance Windows registry toolkit inspired by [node-regedit](https://github.com/ironSource/node-regedit), powered by Rust with [napi-rs](https://github.com/napi-rs/napi-rs) It enables easy manipulation of the Windows registry with optimized performance.\n\n## Install\n\n```\nnpm install regedit-rs\n```\n\n## Example\n```typescript\nimport { list, createKey, putValue, deleteKey, deleteValue, RegSzValue, RegDwordValue, RegExpandSzValue } from \"regedit-rs\";\n\nasync function main(){\n    const keys = [\"HKCU\\\\Software\\\\regedit-rs\", \"HKCU\\\\Software\\\\regedit-rs\\\\test\"];\n    const result = await list(keys);\n\n    if(!result[keys[0]].exists){\n        return;\n    }\n\n    const nameValue = result[keys[1]].values[\"name\"].value;\n    const newPath = new RegExpandSzValue(`%APPDATA%\\\\${nameValue}`);\n\n    if(newPath.expandedValue !== \"C:\\\\Users\\\\username\\\\AppData\\\\Roaming\\\\test name\"){\n        return;\n    }\n\n    await createKey(\"HKCU\\\\Software\\\\regedit-rs\\\\test\");\n    await putValue({\n        \"HKCU\\\\Software\\\\regedit-rs\\\\test\": {\n            \"name\": new RegSzValue(\"test name\"),\n            \"number\": new RegDwordValue(123),\n            \"path\": newPath\n        }\n    });\n\n    await deleteKey(\"HKCU\\\\Software\\\\regedit-rs\\\\old_test\");\n\n    await deleteValue({\n        \"HKCU\\\\Software\\\\regedit-rs\\\\test\": [\"name\", \"number\", \"path\"]\n    });\n}\n\nmain();\n```\n\n# API\nEvery function are binded to Rust and support batching to improve performance.\n\n## Reading keys and values\nList registry key(s) and value(s)\n```typescript\nconst res = await list([\"HKCU\\\\SOFTWARE\", \"HKLM\\\\SOFTWARE\", \"HKCU\\\\DONT_EXIST\"]);\n```\nResult will be an object with the following structure:\n```javascript\n{\n    \"HKCU\\\\SOFTWARE\": {\n        \"exists\": true,\n        keys: [\"HKCU\\\\SOFTWARE\\\\Microsoft\", \"HKCU\\\\SOFTWARE\\\\regedit-rs\", ...],\n        values: {\n            szValue: [RegSzValue] // RegSzValue is a class with a value property\n            dwordValue: [RegDwordValue] // RegDwordValue is a class with a value property\n            expandSzValue: [RegExpandSzValue] // RegExpandSzValue is a class with a value and expandedValue property\n        }\n    },\n    \"HKLM\\\\SOFTWARE\": {\n        \"exists\": true,\n        keys: [\"HKLM\\\\SOFTWARE\\\\Microsoft\", \"HKLM\\\\SOFTWARE\\\\regedit-rs\", ...],\n        values: {\n            szValue: [RegSzValue]\n            dwordValue: [RegDwordValue]\n            qwordValue: [RegQwordValue]\n            expandSzValue: [RegExpandSzValue]\n        }\n    },\n    \"HKCU\\\\DONT_EXIST\": {\n        \"exists\": false,\n        keys: [],\n        values: {}\n    }\n}\n```\n\n## Creating keys\nCreate registry key(s) if not exists\n```typescript\nawait createKey(\"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test\");\nawait createKey([\"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test\", \"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test2\"]);\n```\n\n## Putting values\nPut or update registry value(s)\n```typescript\nawait putValue({\n    \"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test\": {\n        \"name\": new RegSzValue(\"test name\"),\n        \"number\": new RegDwordValue(123),\n        \"path\": new RegExpandSzValue(\"%APPDATA%\\\\test name\")\n    }\n});\n```\n\n## Deleting keys\nDelete registry key(s) and all subkeys\n```typescript\nawait deleteKey(\"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test\");\nawait deleteKey([\"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test\", \"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test2\"]);\n```\n\n## Deleting values\nDelete registry value(s)\n```typescript\nawait deleteValue({\n    \"HKCU\\\\SOFTWARE\\\\regedit-rs\\\\test\": [\"name\", \"number\", \"path\"]\n});\n```\n\n## More\nSee all types, functions, and classes at [index.d.ts](./index.d.ts)\n\n# Sample Benchmark\n\n```shell\nnpm run bench\n```\n\n```shell\nRunning \"List keys and values of a registry key\" suite...\nProgress: 100%\n\n  regedit-rs:\n    3 162 ops/s, ±1.01%   | fastest\n\n  regedit:\n    18 ops/s, ±0.37%      | slowest, 99.43% slower\n\n  winreg:\n    33 ops/s, ±0.60%      | 98.96% slower\n\nFinished 3 cases!\n  Fastest: regedit-rs\n  Slowest: regedit\nRunning \"Create a registry key\" suite...\nProgress: 100%\n\n  regedit-rs:\n    116 548 ops/s, ±0.74%   | fastest\n\n  regedit:\n    22 ops/s, ±0.64%        | slowest, 99.98% slower\n\n  winreg:\n    43 ops/s, ±1.00%        | 99.96% slower\n\nFinished 3 cases!\n  Fastest: regedit-rs\n  Slowest: regedit\nRunning \"Put a registry value\" suite...\nProgress: 100%\n\n  regedit-rs:\n    59 015 ops/s, ±0.77%   | fastest\n\n  regedit:\n    22 ops/s, ±0.92%       | slowest, 99.96% slower\n\n  winreg:\n    43 ops/s, ±0.85%       | 99.93% slower\n\nFinished 3 cases!\n  Fastest: regedit-rs\n  Slowest: regedit\n```\n\n# Test or Contributing\n\n- Clone this repo\n- Install latest stable Rust\n- Install Node.js 10+\n- Install dependencies with `npm install`\n- Build bindings with `npm run build`\n- Run `npm test`\n\n## Release package\n\nWe use GitHub actions to automatically publish npm packages.\n\n```bash\n# 1.0.0 =\u003e 1.0.1\nnpm version patch\n\n# or 1.0.0 =\u003e 1.1.0\nnpm version minor\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzagrios%2Fregedit-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzagrios%2Fregedit-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzagrios%2Fregedit-rs/lists"}