{"id":19478888,"url":"https://github.com/xan105/node-vdf","last_synced_at":"2026-05-15T04:35:40.889Z","repository":{"id":196133504,"uuid":"694263636","full_name":"xan105/node-vdf","owner":"xan105","description":"Valve VDF Key/Value format parser (text and binary)","archived":false,"fork":false,"pushed_at":"2023-10-25T10:03:46.000Z","size":1448,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T09:33:10.361Z","etag":null,"topics":["binary","key","node","steam","value","valve","vdf"],"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/xan105.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"xan105","custom":"https://www.paypal.me/xan105","patreon":"xan105"}},"created_at":"2023-09-20T16:40:13.000Z","updated_at":"2024-12-11T06:25:42.000Z","dependencies_parsed_at":"2023-09-21T13:56:46.874Z","dependency_job_id":"51a6a954-9464-4bf9-8f8c-21d01cdad90c","html_url":"https://github.com/xan105/node-vdf","commit_stats":null,"previous_names":["xan105/node-vdf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xan105/node-vdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-vdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-vdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-vdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-vdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xan105","download_url":"https://codeload.github.com/xan105/node-vdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-vdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33053946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"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":["binary","key","node","steam","value","valve","vdf"],"created_at":"2024-11-10T19:51:55.672Z","updated_at":"2026-05-15T04:35:40.872Z","avatar_url":"https://github.com/xan105.png","language":"JavaScript","funding_links":["https://github.com/sponsors/xan105","https://www.paypal.me/xan105","https://patreon.com/xan105"],"categories":[],"sub_categories":[],"readme":"About\n=====\n\nValve VDF Key/Value format parser (text and binary).\n\nThis format can be found in Steam protobuffer message and in the Steam Client files as well as some Source Engine stuff.\n\n📦 Scoped `@xan105` packages are for my own personal use but feel free to use them.\n\nExample\n=======\n\nReading binary VDF .bin file\n\n```js\nimport { parse } from \"@xan105/vdf/binary\";\nimport { readFile } from \"node:fs/promises\";\n\nconst filePath = \"C:\\\\Program Files (x86)\\\\Steam\\\\appcache\\\\stats\\\\UserGameStatsSchema_218620.bin\";\nconst buffer = await readFile(filePath);\nconst vdf = parse(buffer);\n```\n\nReading text VDF file\n\n```js\nimport { parse } from \"@xan105/vdf\";\nimport { readFile } from \"node:fs/promises\";\n\nconst filePath = \"C:\\\\Program Files (x86)\\\\Steam\\\\appcache\\\\localization.vdf\";\nconst string = await readFile(filePath, \"utf8\");\nconst vdf = parse(string);\n```\n\nInstall\n=======\n\n```\nnpm install @xan105/vdf\n```\n\nAPI\n===\n\n⚠️ This module is only available as an ECMAScript module (ESM).\n\n## Named export\n\n#### `parse(string: string, option?: object): object`\n\nDecode the VDF key/value text formatted string into an object.\n\n⚙️ Options\n\n- translate?: boolean | object \n\n  translate option accepts the following object for granular control or a boolean which force all options to true/false:\n  \n|name|type|default|description|\n|----|----|-------|-----------|\n|bool|boolean|true|String to boolean|\n|number|boolean|false|String to number or [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)|\n|unsafe|boolean|false|Set to true to keep unsafe integer instead of bigint|\n\n❌ Throws on error\n\nExample:\n\n```js\nimport { parse } from \"@xan105/vdf\";\nimport { readFile } from \"node:fs/promises\";\n\nconst filePath = \"steam_input_for_ps4_controller.vdf\";\nconst string = await readFile(filePath, \"utf8\");\n\nconst vdf = parse(string, { translate: {\n  bool: true,\n  number: true,\n  unsafe: false\n}});\n\n//All values will be string\nconst vdf = parse(string, { translate: false });\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e⚠️ JSON compatibility\u003c/summary\u003e\n\nSome integers will be represented as **BigInt** due to their size if the related translate options are used.\u003cbr/\u003e\n**BigInt is not a valid value in the JSON spec**.\u003cbr/\u003e\nAs such when stringify-ing the returned object you'll need to handle the JSON stringify replacer function to prevent it to fail.\n\nA common workaround is to represent them as a string:\n\n```js\nJSON.stringify(data, function(key, value) {\n  if(typeof value === \"bigint\")\n    return value.toString();\n  else\n    return value;\n});\n```\n\n\u003c/details\u003e\n\n### `binary`\n\n#### `parse(buffer: Buffer, offset?: number[]): object`\n\nDecode the VDF key/value binary formatted buffer into an object (starting at the given offset if any).\n\n_NB: offset is an array so it can be passed by reference_\n\n❌ Throws on error\n\nExample:\n\n```js\nimport { parse } from \"@xan105/vdf/binary\";\nimport { readFile } from \"node:fs/promises\";\n\nconst filePath = \"C:\\\\Program Files (x86)\\\\Steam\\\\appcache\\\\stats\\\\UserGameStatsSchema_218620.bin\";\nconst buffer = await readFile(filePath);\nconst vdf = parse(buffer);\n```\n\n💡 Note that binary \".vdf\" file usually requires additional processing like handling file header.\n\n\u003cdetails\u003e\n\u003csummary\u003e⚠️ JSON compatibility\u003c/summary\u003e\n\nSome numbers will be represented as **BigInt** due to their size ((u)int64).\u003cbr/\u003e\n**BigInt is not a valid value in the JSON spec**.\u003cbr/\u003e\nAs such when stringify-ing the returned object you'll need to handle the JSON stringify replacer function to prevent it to fail.\n\nA common workaround is to represent them as a string:\n\n```js\nJSON.stringify(data, function(key, value) {\n  if(typeof value === \"bigint\")\n    return value.toString();\n  else\n    return value;\n});\n```\n\n\u003c/details\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxan105%2Fnode-vdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxan105%2Fnode-vdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxan105%2Fnode-vdf/lists"}