# parse-flat-xml-dict-pmb

> Parse an XML fragment that contains only a very trivial key-value structure.

Latest version **0.1.1** (published 2020-09-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install parse-flat-xml-dict-pmb
pnpm add parse-flat-xml-dict-pmb
yarn add parse-flat-xml-dict-pmb
bun add parse-flat-xml-dict-pmb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-09-14 |
| First published | 2020-09-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | M.K. |
| Maintainers | mk-pmb |
| Keywords | dict, xml |

## Links

- npm: https://www.npmjs.com/package/parse-flat-xml-dict-pmb
- Repository: https://github.com/mk-pmb/parse-flat-xml-dict-pmb-js
- Homepage: https://github.com/mk-pmb/parse-flat-xml-dict-pmb-js/#readme
- Issues: https://github.com/mk-pmb/parse-flat-xml-dict-pmb-js/issues
- npm.io page: https://npm.io/package/parse-flat-xml-dict-pmb

## Dependencies (2)

- [getown](https://npm.io/package/getown.md) ^1.0.0
- [xmldecode](https://npm.io/package/xmldecode.md) ^0.1.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2020-09-14
- 0.1.0 — 2020-09-13

## README

<!--#echo json="package.json" key="name" underline="=" -->
parse-flat-xml-dict-pmb
=======================
<!--/#echo -->

<!--#echo json="package.json" key="description" -->
Parse an XML fragment that contains only a very trivial key-value structure.
<!--/#echo -->



API
---

This module exports one function:

### readDict(xmlFrag[, opt])

Given an XML fragment `xmlFrag` of suitable structure, return a
dictionary object mapping elements' names to their text content.

A suitable fragment must consist of only whitespace and/or simple elements.
Simple elements have just a name and optional text content.
This means they can not have: a namespace, attributes, child elements.

`opts` is an optional options object that supports these keys:

* `combineTexts`: A function that merges non-first occurrences of an
  element name. It will be called with arguments
  `(oldValue, newText, key, dict)`
  and is expected to return the combined new value.
  If false-y (default), an error is thrown on encounter of a duplicate key.



<!--#toc stop="scan" -->



Known issues
------------

* Needs more/better tests and docs.




&nbsp;


License
-------
<!--#echo json="package.json" key=".license" -->
ISC
<!--/#echo -->

---
_Source: https://npm.io/package/parse-flat-xml-dict-pmb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
