{"id":14483645,"url":"https://github.com/charto/cxsd","last_synced_at":"2025-04-09T08:09:14.564Z","repository":{"id":54629136,"uuid":"45126437","full_name":"charto/cxsd","owner":"charto","description":"Streaming XSD parser and XML parser generator with TypeScript output","archived":false,"fork":false,"pushed_at":"2022-08-22T12:46:29.000Z","size":302,"stargazers_count":113,"open_issues_count":14,"forks_count":54,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T07:09:33.245Z","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/charto.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":"2015-10-28T16:32:09.000Z","updated_at":"2025-03-25T12:38:30.000Z","dependencies_parsed_at":"2022-08-13T22:00:56.525Z","dependency_job_id":null,"html_url":"https://github.com/charto/cxsd","commit_stats":null,"previous_names":["charto/fast-xml"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcxsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcxsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcxsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcxsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charto","download_url":"https://codeload.github.com/charto/cxsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999861,"owners_count":21031046,"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-09-03T00:01:56.595Z","updated_at":"2025-04-09T08:09:14.544Z","avatar_url":"https://github.com/charto.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"cxsd\n====\n\n[![build status](https://travis-ci.org/charto/cxsd.svg?branch=master)](http://travis-ci.org/charto/cxsd)\n[![dependency status](https://david-dm.org/charto/cxsd.svg)](https://david-dm.org/charto/cxsd)\n[![npm version](https://img.shields.io/npm/v/cxsd.svg)](https://www.npmjs.com/package/cxsd)\n\n![Atom screenshot](src/screenshot.png)\n\n`cxsd` is a streaming XSD parser and XML parser generator for Node.js and\n(optionally but highly recommended) [TypeScript](http://www.typescriptlang.org/).\nIt automatically downloads all referenced `.xsd` files and outputs two files for each defined namespace:\n\n- `.js` JavaScript code for Node.js containing a compact state machine table for the [cxml](https://github.com/charto/cxml) parser.\n- `.d.ts` TypeScript definition with JSDoc comments to help editors with tab completion, type verification and tooltips.\n\nSince namespaces map to source files, compiled namespaces can import others like normal JavaScript files.\n\n[cxml](https://github.com/charto/cxml) itself is highly advanced and unlike other JavaScript XML parsers.\nIt fully supports namespaces, derived types and (soon) substitution groups.\nOutput structure is defined mainly by schema, not the XML input.\nYou can correctly parse files with completely unexpected structures (conditions apply) and element names,\nif they refer to a schema mapping the contents to supported equivalents.\n\nUsage\n-----\n\n```bash\necho '{ \"scripts\": { \"cxsd\": \"cxsd\" } }' \u003e package.json\nnpm install cxsd\nnpm run cxsd http://schemas.opengis.net/wfs/1.1.0/wfs.xsd\n```\n\nThe first line just sets up NPM to allow calling `cxsd` without installing it globally. It also works on Windows if you omit the single quotes (`'`).\n\nThis downloads 96 `.xsd` files (total about 720 kilobytes) and produces 9 `.js` files for the XML parser (total about 90 kilobytes)\nand 9 `.d.ts` files (total about 480 kilobytes) for TypeScript editors to statically verify the parser output is correctly used and generally help the programmer.\n\nYou can import the resulting `.d.ts` and `.js` files from TypeScript:\n\n```TypeScript\nimport * as wfs from './xmlns/www.opengis.net/wfs';\nimport * as ows from './xmlns/www.opengis.net/ows';\n\nvar metadata = wfs.document.WFS_Capabilities.OperationsMetadata;\n```\n\nSee how the [Atom](https://atom.io/) editor with [atom-typescript](https://atom.io/packages/atom-typescript) understands the code in the screenshot at the top.\n\nFeatures\n--------\n\n- Automatically download and cache to disk all imported .xsd files\n- Convert XSD contents to ES6 equivalents (generated `.js` files call `cxml` to parse themselves into JavaScript structures)\n  - Types to classes\n    - Deriving from other types to inheriting other classes\n  - Imports from remote URLs to imports from local relative paths\n  - Strings, numbers and dates to matching primitive types\n  - Lists to arrays\n- To TypeScript equivalents (defined in `.d.ts` for working with source code)\n  - Annotations to JSDoc comments\n  - Enumerations to unions of string literals\n\nRelated projects\n----------------\n\n- [CodeSynthesis XSD](http://codesynthesis.com/projects/xsd/) generates `C++`-based parsers out of XSD schema definitions.\n\nLicense\n=======\n\n[The MIT License](https://raw.githubusercontent.com/charto/cxsd/master/LICENSE)\n\nCopyright (c) 2015-2016 BusFaster Ltd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fcxsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharto%2Fcxsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fcxsd/lists"}