
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@000alen/fuzzy-xml
Advanced tools
fuzzy-xml is a robust TypeScript library designed to parse semi-structured, XML-like tags interleaved with natural language text, commonly found in responses from Large Language Models (LLMs). It gracefully handles fuzzy and malformed tags, ensuring reliable extraction of structured data from otherwise unpredictable outputs.
You can install fuzzy-xml via npm:
npm install @000alen/fuzzy-xml
Or using yarn:
yarn add @000alen/fuzzy-xml
import { FuzzyXMLParser, ParsedNode } from "@000alen/fuzzy-xml";
const llmResponse = `
Here is the summary of our findings:
<findings>
The indemnification clause is overly broad.
Additionally, the limitation of liability is insufficient.
<details>
This could expose us to significant risks.
</details>
</findings>
Please review these points at your earliest convenience.
<recommendations>
We should renegotiate the indemnification terms.
Also, consider increasing the liability cap.
</recommendations>
Thank you.
`;
const parser = new FuzzyXMLParser(llmResponse);
const parsedNodes: ParsedNode[] = parser.parse();
console.log(JSON.stringify(parsedNodes, null, 2));
Output:
[
{
"content": "Here is the summary of our findings:",
"children": []
},
{
"tagName": "findings",
"content": "The indemnification clause is overly broad.\nAdditionally, the limitation of liability is insufficient.",
"children": [
{
"tagName": "details",
"content": "This could expose us to significant risks.",
"children": []
}
]
},
{
"content": "Please review these points at your earliest convenience.",
"children": []
},
{
"tagName": "recommendations",
"content": "We should renegotiate the indemnification terms.\nAlso, consider increasing the liability cap.",
"children": []
},
{
"content": "Thank you.",
"children": []
}
]
The parser accurately captures nested structures, maintaining the hierarchy of tags and their respective contents.
const complexResponse = `
<report>
Overview:
<section>
<title>Revenue Growth</title>
Our revenue increased by 20%.
<details>
Major contributors include product A and product B.
</details>
</section>
<section>
<title>Profit Margins</title>
Profit margins remained stable.
</section>
</report>
`;
const parser = new FuzzyXMLParser(complexResponse);
const parsedNodes = parser.parse();
console.log(JSON.stringify(parsedNodes, null, 2));
Output:
[
{
"tagName": "report",
"content": "Overview:",
"children": [
{
"tagName": "section",
"content": "Our revenue increased by 20%.",
"children": [
{
"tagName": "title",
"content": "Revenue Growth",
"children": []
},
{
"tagName": "details",
"content": "Major contributors include product A and product B.",
"children": []
}
]
},
{
"tagName": "section",
"content": "Profit margins remained stable.",
"children": [
{
"tagName": "title",
"content": "Profit Margins",
"children": []
}
]
}
]
}
]
fuzzy-xml is designed to handle malformed tags without interrupting the parsing process. Text outside of tags or incorrect tag formats are treated as plain text.
const malformedResponse = `
Here is an overview:
<findings>
The terms are unclear.
<details>
Missing clauses on liability.
<!-- Missing closing tag for findings
Recommendations follow.
<recommendations>
Clarify liability clauses.
Add termination conditions.
</recommendations>
`;
const parser = new FuzzyXMLParser(malformedResponse);
const parsedNodes = parser.parse();
console.log(JSON.stringify(parsedNodes, null, 2));
Output:
[
{
"content": "Here is an overview:",
"children": []
},
{
"tagName": "findings",
"content": "The terms are unclear.",
"children": [
{
"tagName": "details",
"content": "Missing clauses on liability.",
"children": []
}
]
},
{
"content": "<!-- Missing closing tag for findings\n\nRecommendations follow.",
"children": []
},
{
"tagName": "recommendations",
"content": "Clarify liability clauses.\nAdd termination conditions.",
"children": []
}
]
Contributions are welcome! Whether it's reporting bugs, suggesting features, or submitting pull requests, your help is appreciated.
git checkout -b feature/YourFeature
git commit -m "Add some feature"
git push origin feature/YourFeature
Please ensure your code adheres to the existing style and includes relevant tests.
This project is licensed under the MIT License.
FAQs

The npm package @000alen/fuzzy-xml receives a total of 0 weekly downloads. As such, @000alen/fuzzy-xml popularity was classified as not popular.
We found that @000alen/fuzzy-xml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.