{"id":15663889,"url":"https://github.com/simenandre/generate-runtypes","last_synced_at":"2025-04-13T02:07:37.509Z","repository":{"id":40416333,"uuid":"349749424","full_name":"simenandre/generate-runtypes","owner":"simenandre","description":"A code generator for Runtypes types. Perfect to create tooling to generate code for Runtypes!","archived":false,"fork":false,"pushed_at":"2025-03-15T16:40:04.000Z","size":597,"stargazers_count":17,"open_issues_count":27,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T02:07:36.827Z","etag":null,"topics":["generator","runtypes","tooling","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simenandre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-03-20T14:35:22.000Z","updated_at":"2023-05-16T11:32:14.000Z","dependencies_parsed_at":"2024-06-13T20:30:07.237Z","dependency_job_id":"32f514e4-8926-4833-a1e6-20361573f7c8","html_url":"https://github.com/simenandre/generate-runtypes","commit_stats":{"total_commits":127,"total_committers":10,"mean_commits":12.7,"dds":0.5669291338582677,"last_synced_commit":"c2137c9a40ccbef77982e01bb2ec298345766654"},"previous_names":["cobraz/generate-runtypes"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Fgenerate-runtypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Fgenerate-runtypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Fgenerate-runtypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simenandre%2Fgenerate-runtypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simenandre","download_url":"https://codeload.github.com/simenandre/generate-runtypes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654095,"owners_count":21140236,"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":["generator","runtypes","tooling","typescript"],"created_at":"2024-10-03T13:40:20.845Z","updated_at":"2025-04-13T02:07:37.486Z","avatar_url":"https://github.com/simenandre.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"520\" src=\"./.github/header.svg\" alt=\"Generate Runtypes types\"\u003e\n  \n  A code generator for Runtypes types\n\n[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![NPM version](https://img.shields.io/npm/v/generate-runtypes.svg)](https://www.npmjs.com/package/generate-runtypes)\n[![codecov](https://codecov.io/gh/cobraz/generate-runtypes/branch/main/graph/badge.svg)](https://codecov.io/gh/cobraz/generate-runtypes)\n\n\u003c/div\u003e\n\nThis library aims to provide an intuitive and easy way to generate\n[Runtypes][runtypes] types. This package aims to be a great utility for a\nconversion package (e.g. JSON Schema to Runtypes).\n\nWe are thankful for all help with adding new functionality, fixing issues, or\nimprove the package. Feel free to open issues and pull requests ❤️\n\n## Documentation\n\nApart from this README, you can find details and examples of using the SDK in\nthe following places:\n\n- [API Documentation][docs]\n\n## Example\n\n```typescript\nimport { generateRuntypes } from 'generate-runtypes';\n\nconst sourceCode = generateRuntypes([\n  {\n    name: 'Comment',\n    type: {\n      kind: 'record',\n      fields: [\n        { name: 'author', type: { kind: 'string' } },\n        { name: 'body', type: { kind: 'string' } },\n        { name: 'timestamp', type: { kind: 'number' } },\n      ],\n    },\n  },\n  {\n    name: 'Post',\n    export: true,\n    type: {\n      kind: 'record',\n      fields: [\n        { name: 'title', type: { kind: 'string' } },\n        { name: 'body', type: { kind: 'string' } },\n        { name: 'author', type: { kind: 'string' } },\n        {\n          name: 'comments',\n          type: { kind: 'array', type: { kind: 'named', name: 'Comment' } },\n        },\n      ],\n    },\n  },\n]);\n```\n\nThe generated code looks like this after formatting:\n\n```typescript\nimport * as rt from 'runtypes';\n\nconst Comment = rt.Record({\n  author: rt.String,\n  body: rt.String,\n  timestamp: rt.Number,\n});\n\nexport const Post = rt.Record({\n  title: rt.String,\n  body: rt.String,\n  author: rt.String,\n  comments: rt.Array(Comment),\n});\n```\n\n[runtypes]: https://github.com/pelotom/runtypes\n[docs]: ./docs\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimenandre%2Fgenerate-runtypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimenandre%2Fgenerate-runtypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimenandre%2Fgenerate-runtypes/lists"}