{"id":48176798,"url":"https://github.com/razroo/tyson","last_synced_at":"2026-04-04T17:38:43.085Z","repository":{"id":106286144,"uuid":"476246611","full_name":"razroo/tyson","owner":"razroo","description":"Use Typescript in JSON. Self Document DevOps. Make DevOps easy + stable. 🤯","archived":false,"fork":false,"pushed_at":"2025-04-16T12:46:58.000Z","size":71,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-16T18:28:58.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/razroo.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":"2022-03-31T09:56:10.000Z","updated_at":"2025-04-16T13:10:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4fe8254-003c-477b-84b3-7c17e414f4db","html_url":"https://github.com/razroo/tyson","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/razroo/tyson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razroo%2Ftyson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razroo%2Ftyson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razroo%2Ftyson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razroo%2Ftyson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/razroo","download_url":"https://codeload.github.com/razroo/tyson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razroo%2Ftyson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":[],"created_at":"2026-04-04T17:38:43.025Z","updated_at":"2026-04-04T17:38:43.077Z","avatar_url":"https://github.com/razroo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tyson - Use Typescript in JSON\n\nTyson allows you to use TypeScript interfaces for JSON with enhanced features:\n\n## Benefits\n1. Re-use Typescript interfaces for JSON schemas.\n2. Allows comments in JSON \n3. No need for key values to be strings \n4. Can use variables for JSON\n5. Import all configs into a singular config\n\n## Installation\n\n```bash\n# Install globally\nnpm install -g @razroo/tyson\n\n# Or install locally in your project\nnpm install --save @razroo/tyson\n```\n\n## Usage\n\n### Define a TypeScript interface\n\n```typescript\n// test.interface.ts\nexport interface TsonTest {\n  title: string;\n  position: number;\n  type: string;\n}\n```\n\n### Create a tyson file\n\n```typescript\n// test.tyson or test.tson\nimport { TsonTest } from './test.interface';\n\n// Comments are allowed!\n{: TsonTest\n  title: \"sample title\",\n  position: 0,\n  type: \"sample type\", // Inline comments work too\n} \n```\n\n### Compile to JSON\n\n```bash\n# CLI usage\ntyson test.tyson test.json\n\n# With options\ntyson --input test.tyson --output test.json --interface test.interface.ts --interface-name TsonTest\n```\n\n### Programmatic Usage\n\n```typescript\nimport { compileTyson, parseTyson } from 'tyson';\n\n// Compile a tyson file to JSON\ncompileTyson({\n  inputFile: 'test.tyson',\n  outputFile: 'test.json',\n  interfaceFile: 'test.interface.ts',\n  interfaceName: 'TsonTest'\n});\n\n// Or parse a tyson file and get the data\nconst data = parseTyson({\n  inputFile: 'test.tyson',\n  interfaceFile: 'test.interface.ts',\n  interfaceName: 'TsonTest'\n});\n```\n\n### Result\n\nThe compiled JSON will look like:\n\n```json\n{\n  \"title\": \"sample title\",\n  \"position\": 0,\n  \"type\": \"sample type\"\n}\n```\n\n## Features\n\n- **Type Checking**: Validates your JSON against TypeScript interfaces\n- **Comments**: Include comments in your JSON files that won't appear in the output\n- **Unquoted Keys**: No need to quote object keys\n- **TypeScript Integration**: Seamlessly work with your existing TypeScript codebase\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazroo%2Ftyson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazroo%2Ftyson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazroo%2Ftyson/lists"}