{"id":17614592,"url":"https://github.com/t1st3/muxml","last_synced_at":"2026-02-12T05:04:22.690Z","repository":{"id":57305765,"uuid":"63854957","full_name":"t1st3/muxml","owner":"t1st3","description":":saxophone: Streaming XML parser and formatter based on sax","archived":false,"fork":false,"pushed_at":"2020-06-03T09:19:04.000Z","size":205,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T04:30:35.197Z","etag":null,"topics":["formatter","parser","stream","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/t1st3.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":"2016-07-21T09:15:14.000Z","updated_at":"2025-01-28T22:09:46.000Z","dependencies_parsed_at":"2022-09-06T21:40:51.905Z","dependency_job_id":null,"html_url":"https://github.com/t1st3/muxml","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/t1st3/muxml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fmuxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fmuxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fmuxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fmuxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t1st3","download_url":"https://codeload.github.com/t1st3/muxml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fmuxml/sbom","scorecard":{"id":864704,"data":{"date":"2025-08-04","repo":{"name":"github.com/t1st3/muxml","commit":"0f26f8f136c44246332993a06fc7f1d8776444b1"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T02:21:55.829Z","repository_id":57305765,"created_at":"2025-08-24T02:21:55.829Z","updated_at":"2025-08-24T02:21:55.829Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29359360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"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":["formatter","parser","stream","xml"],"created_at":"2024-10-22T18:44:09.780Z","updated_at":"2026-02-12T05:04:22.673Z","avatar_url":"https://github.com/t1st3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# muxml [![Build Status Travis](https://travis-ci.org/t1st3/muxml.svg?branch=master)](https://travis-ci.org/t1st3/muxml) [![Coverage Status](https://codecov.io/gh/t1st3/muxml/badge.svg?branch=master)](https://codecov.io/gh/t1st3/muxml?branch=master)\n\n\u003e Streaming XML parser and formatter\n\n`muxml` is a [Transform stream](https://nodejs.org/api/stream.html#stream_duplex_and_transform_streams) that accepts XML strings, and emits small chunks containing individual XML elements.\n\nThe parser part of this module is built on [`sax`](https://www.npmjs.com/package/sax):saxophone:.\nOn parsing, the stream is broken-up and reassembled so that each opening/closing tag and each text is a chunk. During this process, sax events are re-emitted and are listenable down the pipeline.\n\nOnce XML is parsed, this module can optionally format XML in the following fashions:\n\n* XML minification (de-indentation and removal of newlines)\n* XML beautification (indentation and usage of newlines)\n* striping of comments\n* striping of `CDATA`\n* striping of instruction (like `\u003c?xml foo=\"blerg\" ?\u003e`) tags\n* striping of `\u003c!DOCTYPE` declarations\n* striping of attributes\n* tag filtering based on tag name\n\n`muxml` is written with ES6/ES2015 syntax, although it is also shipped as an ES5 module with UMD syntax, meaning it can also be used:\n\n* in Node.js \u003e= 4\n* in the browser, as global script\n* in the browser, with an AMD loader\n\nAlso available as a [gulp](https://github.com/t1st3/gulp-muxml) / [Grunt](https://github.com/t1st3/grunt-muxml) plugin, or as a [CLI](https://github.com/t1st3/muxml-cli) app.\n\n\n## Install\n\n```\n$ npm install --save muxml\n```\n\n## Usage\n\nSuppose a file named `example.xml` containing the follwing XML\n\n```xml\n\u003ca id=\"foo\"\u003e\n  \u003cb\u003e\n    \u003cc\u003ed\u003c/c\u003e\n  \u003c/b\u003e\n\u003c/a\u003e\n```\n\nthen, `muxml()` returns a transform stream that accepts XML strings and emits XML elements as strings\n\n```js\nconst muxml = require('muxml');\n\nfs.createReadStream('example.xml')\n  .pipe(muxml({pretty: false}))\n  .on('data', function (data) {\n    console.log(data);\n    //=\u003e '\u003cb\u003e\u003cc\u003ed\u003c/c\u003e\u003c/b\u003e'\n  });\n```\n\n## Options\n\n### strict\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nSet [`sax` parser `strict` argument](https://www.npmjs.com/package/sax#arguments)\n\n### pretty\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nPrettify the output. If true, output has newlines and indentation.\n\n### indentStyle\n\nType: `string`\u003cbr\u003e\nDefault: `spaces`\n\nWhen `pretty` is set to true, indent with either `spaces` or `tabs`.\n\n### indentSpaces\n\nType: `integer`\u003cbr\u003e\nDefault: `2`\n\nWhen `pretty` is set to true and `indentStyle` is set to `spaces`, then indent with this number of spaces.\n\n### indentTabs\n\nType: `integer`\u003cbr\u003e\nDefault: `1`\n\nWhen `pretty` is set to true and `indentStyle` is set to `tabs`, then indent with this number of tabs.\n\n#### filter\n\nType: `string`\u003cbr\u003e\nDefault: `null`\u003cbr\u003e\na filter for tag names\n\nFilter XML with tags with name matching the filter.\n\n### stripAttributes\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nStrip attributes from tags.\n\n### stripCdata\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nStrip `CDATA` tags.\n\n### stripComments\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nStrip XML comments.\n\n### stripDoctype\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nStrip `\u003c!DOCTYPE` declarations.\n\n### stripInstruction\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nStrip processing instruction (like `\u003c?xml foo=\"blerg\" ?\u003e`) tags.\n\n### saxOptions\n\nType: `object`\u003cbr\u003e\nDefault: `{}`\n\nSet [options of `sax` parser](https://www.npmjs.com/package/sax#arguments). Note that `trim` can not be set to `false`.\n\n\n## API\n\n### muxml(options)\n\n#### options\n\nType: `object`\u003cbr\u003e\nas described above\n\n\n## Related\n\n* [muxml-cli](https://github.com/t1st3/muxml-cli) | CLI for this module\n* [gulp-muxml](https://github.com/t1st3/gulp-muxml) | this module as a [`gulp`](http://gulpjs.com/) plugin\n* [grunt-muxml](https://github.com/t1st3/grunt-muxml) | this module as a [`Grunt`](http://gruntjs.com/) plugin\n\n\n## License\n\nMIT © [t1st3](https://t1st3.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1st3%2Fmuxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft1st3%2Fmuxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1st3%2Fmuxml/lists"}