{"id":31225916,"url":"https://github.com/borewit/file-type-xml","last_synced_at":"2026-02-15T16:19:37.008Z","repository":{"id":268626660,"uuid":"904978280","full_name":"Borewit/file-type-xml","owner":"Borewit","description":"Detector plugin for file-type for XML files","archived":false,"fork":false,"pushed_at":"2025-09-15T06:44:19.000Z","size":206,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T21:00:49.107Z","etag":null,"topics":["detection","detector","file-type","kml","svg","xml"],"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/Borewit.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,"zenodo":null},"funding":{"github":"Borewit","buy_me_a_coffee":"borewit"}},"created_at":"2024-12-17T23:13:16.000Z","updated_at":"2025-08-31T20:01:37.000Z","dependencies_parsed_at":"2024-12-17T23:37:50.908Z","dependency_job_id":"15eefdf0-b7d8-4290-a450-b8dccb471335","html_url":"https://github.com/Borewit/file-type-xml","commit_stats":null,"previous_names":["borewit/file-type-xml"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Borewit/file-type-xml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Ffile-type-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Ffile-type-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Ffile-type-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Ffile-type-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Borewit","download_url":"https://codeload.github.com/Borewit/file-type-xml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Borewit%2Ffile-type-xml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276333934,"owners_count":25624049,"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","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["detection","detector","file-type","kml","svg","xml"],"created_at":"2025-09-22T02:00:09.829Z","updated_at":"2026-02-15T16:19:36.990Z","avatar_url":"https://github.com/Borewit.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Borewit","https://buymeacoffee.com/borewit"],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://img.shields.io/npm/v/@file-type/xml.svg)](https://npmjs.org/package/@file-type/xml)\n[![Node.js CI](https://github.com/Borewit/file-type-xml/actions/workflows/nodejs-ci.yml/badge.svg)](https://github.com/Borewit/file-type-xml/actions/workflows/nodejs-ci.yml)\n[![npm downloads](http://img.shields.io/npm/dm/@file-type/xml.svg)](https://npmcharts.com/compare/@file-type/xml?start=365)\n\n# @file-type/xml\n\nDetector plugin for [file-type](https://github.com/sindresorhus/file-type) for XML files.\n\n## Installation\n\n```bash\nnpm install @file-type/xml\n```\n\n## Usage\n\nThe following example shows how to add the XML detector to [file-type](https://github.com/sindresorhus/file-type).\n```js\nimport {FileTypeParser} from 'file-type';\nimport {detectXml} from '@file-type/xml';\n\nconst parser = new FileTypeParser({customDetectors: [detectXml]});\nconst fileType = await parser.fromFile('example.kml');\nconsole.log(fileType);\n```\n\nYou can also use the XML detector outside [file-type](https://github.com/sindresorhus/file-type):\n```js\nimport {XmlTextDetector} from '@file-type/xml';\n\nconst xmlTextDetector = new XmlTextDetector();\nxmlTextDetector.write('\u003csvg xmlns=\"http://www.w3.org/2000/svg\"\u003e\u003cpath fill=\"#00CD9F\"/\u003e\u003c/svg\u003e');\nconst fileType = xmlTextDetector.fileType;\nconsole.log(JSON.stringify(fileType)); // Outputs: {\"ext\":\"svg\",\"mime\":\"image/svg+xml\"}\n```\n\n## Support file formats\n\n- [XML](https://en.wikipedia.org/wiki/XML) (default for XML, unless a more specific format was detected)\n- [Apple Property list, `.plist`](https://en.wikipedia.org/wiki/Property_list)\n- [Atom](\u003chttps://en.wikipedia.org/wiki/Atom_(web_standard)\u003e)\n- [DocBook](https://en.wikipedia.org/wiki/DocBook)\n- [GML (Geography Markup Language)](https://en.wikipedia.org/wiki/Geography_Markup_Language)\n- [GPX (GPS Exchange Format)](https://en.wikipedia.org/wiki/GPS_Exchange_Format)\n- [KML (Keyhole Markup Language)](https://en.wikipedia.org/wiki/Keyhole_Markup_Language)\n- [MathML (Mathematical Markup Language)](https://en.wikipedia.org/wiki/MathML)\n- [MusicXML, Uncompressed](https://en.wikipedia.org/wiki/MusicXML)\n- [OPML (Outline Processor Markup Language)](https://en.wikipedia.org/wiki/OPML)\n- [RSS (RDF Site Summary or Really Simple Syndication)](https://en.wikipedia.org/wiki/RSS)\n- [SMIL: (Synchronized Multimedia Integration Language)](https://en.wikipedia.org/wiki/Synchronized_Multimedia_Integration_Language)\n- [SVG: (Scalable Vector Graphics)](https://en.wikipedia.org/wiki/SVG)\n- [TEI, Text Encoding Initiative](https://en.wikipedia.org/wiki/Text_Encoding_Initiative)\n- [TTML: (Timed Text Markup Language)](https://en.wikipedia.org/wiki/Timed_Text_Markup_Language)\n- [X3D (Extensible 3D)](https://en.wikipedia.org/wiki/X3D)\n- [XHTML](https://en.wikipedia.org/wiki/XHTML)\n- [XLIFF (XML Localization Interchange File Format)](https://en.wikipedia.org/wiki/XLIFF)\n\n## Licence\n\nThis project is licensed under the [MIT License](LICENSE.txt). Feel free to use, modify, and distribute as needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborewit%2Ffile-type-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborewit%2Ffile-type-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborewit%2Ffile-type-xml/lists"}