{"id":23763760,"url":"https://github.com/tomashubelbauer/keytar-vscode-extension","last_synced_at":"2026-04-26T20:32:11.795Z","repository":{"id":107986166,"uuid":"135063873","full_name":"TomasHubelbauer/keytar-vscode-extension","owner":"TomasHubelbauer","description":"Keytar in VS Code extension experiment","archived":false,"fork":false,"pushed_at":"2022-04-28T08:49:26.000Z","size":54,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T16:41:28.529Z","etag":null,"topics":["dpapi","keychain","keytar","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","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/TomasHubelbauer.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,"zenodo":null}},"created_at":"2018-05-27T16:36:07.000Z","updated_at":"2022-04-17T10:00:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"c5c288df-09d2-459c-9679-0fd76b3fc920","html_url":"https://github.com/TomasHubelbauer/keytar-vscode-extension","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TomasHubelbauer/keytar-vscode-extension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fkeytar-vscode-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fkeytar-vscode-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fkeytar-vscode-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fkeytar-vscode-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomasHubelbauer","download_url":"https://codeload.github.com/TomasHubelbauer/keytar-vscode-extension/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fkeytar-vscode-extension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32312263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dpapi","keychain","keytar","vscode","vscode-extension"],"created_at":"2024-12-31T22:13:27.657Z","updated_at":"2026-04-26T20:32:11.790Z","avatar_url":"https://github.com/TomasHubelbauer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keytar VS Code Extensions\n\n`npm install` \u0026 `npm start` here or in `electron`.\n\nThis repository demonstrates a weird Keytar issue where when loaded dynamically\nusing `require` from a `node` file, the library seemingly works (doesn't work,\nbut doesn't throw an error either) and just before the process exits, it throws\na junk exception:\n\n```\n# Fatal error in , line 0\n# Check failed: receiver-\u003eIsJSFunction().\n# FailureMessage Object: 000000B5BCDBDA20npm\n# errno 3221225477\n```\n\n(In the `electron` repro the file name and line number is okay.)\n\nThe `require` seems to go through and resolves to the correct instance whose\nmethods `setPassword` and `findPassword` both work as well, but then it crashes.\n\nFunnily enough, when the last line of code is `process.exit(0)`, it doesn't crash,\neven though there is no more code in either case. It's almost as if some sort of\na destructor ran and in it the library threw the exception and `process.exit`\nprevented it from running thus leaking the library.\n\nOf course this workaround doesn't help because the `findPassword` method still\nreturns `undefined`.\n\nI have filed a Keytar [GitHub issue](https://github.com/atom/node-keytar/issues/106)\nfor this problem linking to this repro.\n\n---\n\nIn https://github.com/microsoft/vscode/issues/68738 it is shown how to use VS\nCode's bundled Keytar which might be an acceptable workaround / fallback mechanism.\n\nThis is prototyped in `code` - instead of scaffolding and committing the\nextensions, I do that on the fly using Yeoman so that it's code doesn't go out\nof date or interfere with understanding of the core of the workaround.\n\n```js\nasync function activate() {\n\tconst keytar = require('keytar');\n\tawait keytar.setPassword('TEST', 'Tom', 'PASSW0RD');\n\tconst password = await keytar.getPassword('TEST', 'Tom');\n}\n```\n\n## To-Do\n\n### Finalize patching the generated extension's `package.json`\n\nTo have a `*` for an activation event and for its `activate` to be the above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fkeytar-vscode-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomashubelbauer%2Fkeytar-vscode-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fkeytar-vscode-extension/lists"}