{"id":23902971,"url":"https://github.com/marcomilon/micro-form-js","last_synced_at":"2025-02-23T10:44:59.078Z","repository":{"id":173105809,"uuid":"347797015","full_name":"marcomilon/micro-form-js","owner":"marcomilon","description":"A port of micro-form to JavaScript","archived":false,"fork":false,"pushed_at":"2021-03-28T21:26:59.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-15T07:26:50.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcomilon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-03-15T01:12:27.000Z","updated_at":"2022-09-30T07:27:55.000Z","dependencies_parsed_at":"2023-06-29T08:45:16.930Z","dependency_job_id":null,"html_url":"https://github.com/marcomilon/micro-form-js","commit_stats":null,"previous_names":["marcomilon/micro-form-js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomilon%2Fmicro-form-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomilon%2Fmicro-form-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomilon%2Fmicro-form-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcomilon%2Fmicro-form-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcomilon","download_url":"https://codeload.github.com/marcomilon/micro-form-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240304564,"owners_count":19780312,"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":[],"created_at":"2025-01-04T22:51:21.658Z","updated_at":"2025-02-23T10:44:59.054Z","avatar_url":"https://github.com/marcomilon.png","language":"JavaScript","readme":"# micro-form-js\n\nA port of micro-form to JavaScript. The goal of this library is to be able to generate an Html Form from JSON.\n\n## Example\n\n**Examples**\n\n**Input**\n\n```javascript\n\njson = [\n    {\n        \"tag\": \"input\",\n        \"type\": \"text\",\n        \"name\": \"username\",\n        \"class\": \"form-control\"\n    }\n]\n\nconsole.log(renderForm(input))\n```\n\n*output*\n\n```html \n\u003cinput type=\"text\" name=\"username\" class=\"form-control\"\u003e\n```\n\n**Textarea**\n\n```javascript\n\njson = [\n    {\n        \"tag\": \"textarea\",\n        \"id\": \"story\",\n        \"name\": \"story\",\n        \"rows\": \"5\",\n        \"cols\": \"33\",\n        \"value\": \"It was a dark and stormy night...\"\n    }\n]\n\nconsole.log(renderForm(input))\n```\n\n*output*\n\n```html\n\u003ctextarea id=\"story\" name=\"story\" rows=\"5\" cols=\"33\"\u003e\nIt was a dark and stormy night...\n\u003c/textarea\u003e\n```\n\n**Select**\n\n```javascript\n\njson = [\n    {\n        \"tag\": \"select\",\n        \"name\": \"pets\",\n        \"id\": \"pet-select\",\n        \"value\": [\n            {\n                \"tag\": \"option\",\n                \"label\": \"--Please choose an option--\",\n                \"value\": \"\"\n            },\n            {\n                \"tag\": \"option\",\n                \"label\": \"Dog\",\n                \"value\": \"dog\"\n            },\n            {\n                \"tag\": \"option\",\n                \"label\": \"Cat\",\n                \"value\": \"cat\"\n            }\n        ]\n    }\n];\n\nconsole.log(renderForm(input))\n```\n\n*output*\n\n```html\n\u003cselect name=\"pets\" id=\"pet-select\"\u003e\n    \u003coption value=\"\"\u003e--Please choose an option--\u003c/option\u003e\n    \u003coption value=\"dog\"\u003eDog\u003c/option\u003e\n    \u003coption value=\"cat\"\u003eCat\u003c/option\u003e\n\u003c/select\u003e\n```\n\n### Contribution\n\nFeel free to contribute! Just create a new issue or a new pull request.\n\n### License\n\nThis library is released under the MIT License.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcomilon%2Fmicro-form-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcomilon%2Fmicro-form-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcomilon%2Fmicro-form-js/lists"}