{"id":19704547,"url":"https://github.com/spencertorres/fgd","last_synced_at":"2026-05-04T18:35:45.557Z","repository":{"id":57234992,"uuid":"119345759","full_name":"SpencerTorres/fgd","owner":"SpencerTorres","description":"An NPM package for manipulating FGD (Forge Game Data) files.","archived":false,"fork":false,"pushed_at":"2018-01-29T07:59:52.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-18T20:42:57.566Z","etag":null,"topics":["converter","fgd","goldsrc","hammer","nodejs","npm","parser","source","valve"],"latest_commit_sha":null,"homepage":null,"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/SpencerTorres.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}},"created_at":"2018-01-29T07:11:35.000Z","updated_at":"2024-12-18T20:11:04.000Z","dependencies_parsed_at":"2022-08-23T15:31:23.219Z","dependency_job_id":null,"html_url":"https://github.com/SpencerTorres/fgd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpencerTorres%2Ffgd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpencerTorres%2Ffgd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpencerTorres%2Ffgd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpencerTorres%2Ffgd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpencerTorres","download_url":"https://codeload.github.com/SpencerTorres/fgd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241020097,"owners_count":19895368,"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":["converter","fgd","goldsrc","hammer","nodejs","npm","parser","source","valve"],"created_at":"2024-11-11T21:23:13.377Z","updated_at":"2026-05-04T18:35:45.491Z","avatar_url":"https://github.com/SpencerTorres.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FGD\nAn [NPM package](https://www.npmjs.com/package/fgd) for manipulating FGD (Forge Game Data) files.\n\nYou can learn more about FGD files here:\n- [Anatomy of an FGD (and How to Write Your Own) - Valve Developer Union](https://valvedev.info/guide/eoZl)\n- [FGD - Valve Developer Community](https://developer.valvesoftware.com/wiki/FGD)\n\nThis module can do the following:\n- convert FGD to JSON\n- convert JSON to FGD\n\n## Functions\n\n### `fgd.toJSON(fgdString)`\nThis method takes a `string` of FGD, and outputs a JSON `object`.\n### `fgd.fromJSON(fgdObject)`\nThis method takes a JSON `object`, and outputs a `string` of FGD.\n\n\n## Example Usage\n\n```javascript\n// Import FGD package\nconst fgd = require('fgd')\n\n// Read FGD file as string\nconst FGD_TEXT = require('fs').readFileSync(`game.fgd`, 'utf-8')\n\n// Convert FGD string to JSON\nlet fgdAsJSON = fgd.toJSON(FGD_TEXT)\n\n// Convert JSON back to FGD string\nlet jsonAsFGD = fgd.fromJSON(fgdAsJSON)\n```\n\n## Example Inputs/Outputs\n\n### Example FGD\n```fgd\n@PointClass = example : \"Example Entity\"\n[\n\tproperty(string) : \"A property with a string type.\"\n]\n```\n### Example JSON\n```json\n{\n  \"includes\": [],\n  \"entities\": [\n    {\n      \"name\": \"example\",\n      \"type\": \"PointClass\",\n      \"description\": \"Example Entity\",\n      \"properties\": [\n        {\n          \"type\": \"string\",\n          \"name\": \"property\",\n          \"title\": \"A property with a string type.\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n`includes` will be an array of filenames to include at the top of the FGD.\n\n## Future\n\nThis is a quickly modified version of leops' original [fgdparser](https://github.com/leops/fgdparser).\nIt adds a two-way converter with JSON, and some other small features and enhancements.\nIf you want to add/optimize any features, feel free to make a pull request.\n\n## License\nThe fgd package is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspencertorres%2Ffgd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspencertorres%2Ffgd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspencertorres%2Ffgd/lists"}