# @netless/xml-js

> A converter between XML text and Javascript object / JSON text.

Latest version **1.6.16** (published 2022-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @netless/xml-js
pnpm add @netless/xml-js
yarn add @netless/xml-js
bun add @netless/xml-js
```

Provides the command `xml-js`.

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.16 |
| Published | 2022-12-07 |
| First published | 2021-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 462.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yousuf Almarzooqi |
| Maintainers | vince-hz, alic_zhang, straybugs, moskize, netless-rick, yleaf, herewhite, black_hole, cheerchen, l1shen, hyrious, huaguzheng |
| Keywords | XML, xml, js, JSON, json, cdata, CDATA, doctype, processing instruction, Javascript, js2xml, json2xml, xml2js, xml2json, transform, transformer, transforming, transformation, convert, convertor, converting, conversion, parse, parser, parsing |

## Links

- npm: https://www.npmjs.com/package/@netless/xml-js
- Repository: https://github.com/netless-io/xml-js
- Homepage: https://github.com/netless-io/xml-js#readme
- Issues: https://github.com/netless-io/xml-js/issues
- npm.io page: https://npm.io/package/@netless/xml-js

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.6.16 (latest) — 2022-12-07
- 1.6.15 — 2021-08-05

## README

This fork moves "sax" to "devDependencies" and bundles it with
rollup ([rollup-plugin-node-polyfills](https://github.com/ionic-team/rollup-plugin-node-polyfills)).

([rollup-plugin-polyfill-node](https://github.com/snowpackjs/rollup-plugin-polyfill-node) doesn't work, don't know why)

I also removed tests and coverage for faster setup. :sweat_smile:

Applied these [_useful forks_](https://useful-forks.github.io/?repo=nashwaan%2Fxml-js):

- [Escape `&` `<` in attributes](https://github.com/melody-universe/xml-js)
- [Add nativeTypeAttributes type definition](https://github.com/mariuseis/xml-js/commit/aec4986298b3270ee8f429871907d65d9859b0da)
- [Handling errors with onErrorFn instead of throwing exception on first error](https://github.com/drdmitry/xml-js/commit/3476bb3a7917c6a2f7f464427a2dfd8f479d53c3)
- ... Need more? PR on me!

Install: `npm i @netless/xml-js`.

Replace it in **package.json**:

```json
"dependencies": {
  "xml-js": "npm:@netless/xml-js"
}
```

Replace it in **vite.config.js**:

```js
export default defineConfig({
  alias: {
    "xml-js": "@netless/xml-js"
  }
})
````

Replace it in **webpack.config.js**

```js
{
  "resolve": {
    "alias": {
      "xml-js": "@netless/xml-js"
    }
  }
}
````

Other ways: [see how preact does](https://preactjs.com/guide/v8/switching-to-preact/).

## Todo

- Maybe replace sax with [saxes](https://www.npmjs.com/package/saxes).

## Changelog

### 1.6.15

- Transfer to `@netless/`.

### 1.6.14

- Use named export, for tree shaking purpose.

- - -

Read the original [README](https://github.com/nashwaan/xml-js).

---
_Source: https://npm.io/package/@netless/xml-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
