{"name":"@file-type/xml","version":"0.2.1","keywords":["file-type","detect","detection","detector","XML","signature","namespace","SVG","XHTML","RSS","KML","GML","MusicXML"],"author":{"url":"https://github.com/Borewit","name":"Borewit"},"license":"MIT","_id":"@file-type/xml@0.2.1","maintainers":[{"name":"borewit","email":"borewit@xs4all.nl"}],"homepage":"https://github.com/Borewit/file-type-xml#readme","bugs":{"url":"https://github.com/Borewit/file-type-xml/issues"},"dist":{"shasum":"85ed71fdc07a1660f3fa3ec4a0c8152de53aa200","tarball":"http://registry-npm.ywwl.com/@file-type/xml/download/@file-type/xml-0.2.1.tgz","fileCount":3,"integrity":"sha512-1xx7nxYLTCvEyFAEQzrguFL66QHTJbNNHXxhLW4UpBEqbM+MCE0If7sV/kpQ/4JalpHQTJ8SdDLDn73n2j65nQ==","signatures":[{"sig":"MEYCIQDY8PnnQko7tuyqTO34gsdfsroo7EDeAOFwa4UtVFMDUgIhALqArpw8MjV+9f+IQLdc3PEToHMkZTU/UeUAQ9baXroO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6935,"size":2592,"noattachment":false,"key":"/@file-type/xml/-/@file-type/xml-0.2.1.tgz"},"type":"module","exports":"./lib/index.js","gitHead":"2f99fbff3ba52927b998d50a5355aac6431f1b87","scripts":{"test":"mocha"},"_npmUser":{"name":"borewit","email":"borewit@xs4all.nl"},"repository":{"url":"git+https://github.com/Borewit/file-type-xml.git","type":"git"},"_npmVersion":"10.8.2","description":"XML detection plugin","directories":{},"_nodeVersion":"20.17.0","dependencies":{"sax":"^1.4.1","strtok3":"^10.0.1"},"_hasShrinkwrap":false,"packageManager":"yarn@4.5.3","devDependencies":{"chai":"^5.1.2","mocha":"^11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/xml_0.2.1_1734697996806_0.8988649422498269","host":"s3://npm-registry-packages-npm-production"},"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('<svg xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"#00CD9F\"/></svg>');\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](<https://en.wikipedia.org/wiki/Atom_(web_standard)>)\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","publish_time":1734697996993,"_cnpm_publish_time":1734697996993,"dist-tags":{"latest":"1.2.0"}}