{"id":22092189,"url":"https://github.com/pirxpilot/gexode","last_synced_at":"2025-03-23T23:45:29.164Z","repository":{"id":57250723,"uuid":"1390775","full_name":"pirxpilot/gexode","owner":"pirxpilot","description":"Primitive XML generator for node.js","archived":false,"fork":false,"pushed_at":"2023-03-21T11:34:49.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T10:01:59.662Z","etag":null,"topics":[],"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/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.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}},"created_at":"2011-02-20T23:21:52.000Z","updated_at":"2022-06-05T07:38:05.000Z","dependencies_parsed_at":"2024-11-23T01:03:24.449Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/gexode","commit_stats":{"total_commits":32,"total_committers":3,"mean_commits":"10.666666666666666","dds":0.40625,"last_synced_commit":"579e62a5fdda746736946270a6fc4a8232904ba4"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgexode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgexode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgexode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgexode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/gexode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186926,"owners_count":20574554,"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":"2024-12-01T03:08:36.848Z","updated_at":"2025-03-23T23:45:29.143Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][build-image]][build-url]\n[![Dependency Status][deps-image]][deps-url]\n\n# gexode\n\nPrimitive XML generator for node.js\n\n## Example\n\n```js\nconst { doc, elem } = require(gexode);\nconst car = doc(elem('car', {wheels: 4}).text('Volvo'));\ncar.toString();\n```\n\nrenders as:\n\n```xml\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003ccar wheels='4'\u003eVolvo\u003c/car\u003e\n```\n\n\n## Generator mode\n\n`gexode` can also be used as a generator\n\n```js\nconst { generator } = require('gexode');\nconst { header, start, el, end } = generator({ pretty: true });\n\nfunction* cars() {\n  yield* header();\n  yield* start('cars');\n  yield* el('car', { wheels: 4 }, 'Volvo');\n  yield* end();\n}\n\nArray.from(cars()).join('');\n\n```\n\nrenders as:\n\n```xml\n\u003c?xml version='1.0' encoding='UTF-8'?\u003e\n\u003ccars\u003e\n  \u003ccar wheels='4'\u003eVolvo\u003c/car\u003e\n\u003c/cars\u003e\n```\n\n\n### API\n\n`generator(options)`\n- `options` - `{ pretty, selfClosing }`\n  if `pretty` is truthy intendations are generate\n  if `selfClosing` is truthy empty tags are self closeing `\u003clikeThis/\u003e`\n\n- `header` - generate XML header\n- `el(name, attribute, text)`- generate a node with attributes (optional) and text (optional), close the node automatically\n- `start(name, attribute)`- like `el` but do not close the node\n- `end` - close recently opened node\n\n\n## License\n\nMIT\n\n[npm-image]: https://img.shields.io/npm/v/gexode\n[npm-url]: https://npmjs.org/package/gexode\n\n[build-url]: https://github.com/pirxpilot/gexode/actions/workflows/check.yaml\n[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/gexode/check.yaml?branch=main\n\n[deps-image]: https://img.shields.io/librariesio/release/npm/gexode\n[deps-url]: https://libraries.io/npm/gexode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fgexode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fgexode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fgexode/lists"}