{"_id":"@cjser/file-type__xml__v0_4_4","name":"@cjser/file-type__xml__v0_4_4","dist-tags":{"latest":"0.4.4-cjser.2"},"versions":{"0.4.4-cjser.2":{"name":"@cjser/file-type__xml__v0_4_4","version":"0.4.4-cjser.2","description":"XML detection plugin for file-type","type":"module","types":"./lib/index.d.ts","exports":{"require":"./dist-cjser/index.cjs","default":"./lib/index.js"},"scripts":{"clean":"del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'src/**/*.d.ts'","compile-src":"tsc -p lib","compile":"yarn run  compile-src","lint:ts":"biome check","build":"yarn run clean && yarn compile","test":"mocha","update-biome":"yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write"},"keywords":["file-type","detect","detection","detector","XML","signature","namespace","SVG","XHTML","RSS","KML","GML","MusicXML"],"dependencies":{"sax":"^1.4.1","@cjser/strtok3":"10.3.5-cjser.2"},"devDependencies":{"@biomejs/biome":"2.2.2","@types/sax":"^1.2.7","chai":"^6.0.1","del-cli":"^6.0.0","file-type":"^21.0.0","mocha":"^11.7.1","typescript":"^5.9.2"},"author":{"name":"Borewit","url":"https://github.com/Borewit"},"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"license":"MIT","packageManager":"yarn@4.9.1","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"0.4.4","cjserVersion":2,"original":{"name":"@file-type/xml","version":"0.4.4","exports":"./lib/index.js","repository":{"type":"git","url":"git+https://github.com/Borewit/file-type-xml.git"},"dependencies":{"sax":"^1.4.1","strtok3":"^10.3.4"},"files":["lib/**/*.js","lib/**/*.d.ts","lib/*.cjs"],"scripts":{"clean":"del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'src/**/*.d.ts'","compile-src":"tsc -p lib","compile":"yarn run  compile-src","lint:ts":"biome check","build":"yarn run clean && yarn compile","test":"mocha","prepublishOnly":"yarn run build","update-biome":"yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write"}}},"_id":"@cjser/file-type__xml__v0_4_4@0.4.4-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-2/ct8/9VXpbzc+yKrbRRPaShWLPuy+WNQAcLD5WkuO4pNLF6JTjDPzzI3ZWmhDqOolVokhgBOYx/5sAoEYFhJA==","shasum":"e820678e5da9d302543e0b874a450dbf3fc2f42d","tarball":"https://registry.npmjs.org/@cjser/file-type__xml__v0_4_4/-/file-type__xml__v0_4_4-0.4.4-cjser.2.tgz","fileCount":6,"unpackedSize":18220,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID7ydyQq/UIR7ENWOH1QfPa0tNPVzX12BD7syst3luLvAiEAy8M7MimzJP0bj9NPZ9TO0MfUT35f/thf8Z7FzBparI8="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/file-type__xml__v0_4_4_0.4.4-cjser.2_1778158058957_0.08649768991723139"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T12:47:38.888Z","0.4.4-cjser.2":"2026-05-07T12:47:39.108Z","modified":"2026-05-07T12:47:39.283Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"XML detection plugin for file-type","keywords":["file-type","detect","detection","detector","XML","signature","namespace","SVG","XHTML","RSS","KML","GML","MusicXML"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Borewit","url":"https://github.com/Borewit"},"license":"MIT","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 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 more specific format was detected)\n- [GML (Geography Markup Language)](https://en.wikipedia.org/wiki/Geography_Markup_Language)\n- [KML (Keyhole Markup Language)](https://en.wikipedia.org/wiki/XHTML)\n- [MusicXML, Uncompressed](https://en.wikipedia.org/wiki/MusicXML)\n- [RSS (RDF Site Summary or Really Simple Syndication)](https://en.wikipedia.org/wiki/RSS)\n- [SVG: (Scalable Vector Graphics)](https://en.wikipedia.org/wiki/SVG)\n- [XHTML](https://en.wikipedia.org/wiki/XHTML)\n\n## Licence\n\nThis project is licensed under the [MIT License](LICENSE.txt). Feel free to use, modify, and distribute as needed.\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/Borewit/file-type-xml\n","readmeFilename":"README.md","_rev":"1-a3f68b29bd52f24e61fd193f3a6d9246"}