# aux-xml

> Identify and Read Auxiliary XML Files (e.g., .jpg.aux.xml, .png.aux.xml, and .tif.aux.xml)

Latest version **0.2.0** (published 2022-09-27) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install aux-xml
pnpm add aux-xml
yarn add aux-xml
bun add aux-xml
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-09-27 |
| First published | 2020-09-07 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | aux, gdal, jpg, geospatial, maps, png, tif, xml |

## Links

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

## Dependencies (3)

- [get-byte](https://npm.io/package/get-byte.md) ^0.0.0
- [camelcase](https://npm.io/package/camelcase.md) ^6.2.0
- [xml-utils](https://npm.io/package/xml-utils.md) ^1.0.2

## 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.2.0 (latest) — 2022-09-27
- 0.1.1 — 2022-09-09
- 0.1.0 — 2021-11-02
- 0.0.0 — 2020-09-07

## README

:warning: This project is a work in progress.

# aux-xml
Identify and Read Auxiliary XML Files (e.g., .jpg.aux.xml, .png.aux.xml, and .tif.aux.xml)

# install
```bash
npm install aux-xml
```

# usage
# identify aux.xml files
```js
const fs = require("fs");
const isAuxXML = require("aux-xml/is-aux-xml");

isAuxXML("test.aux.xml");
// true

const text = readFileSync("test.aux.xml", "utf-8");
isAuxXML(text);
// true

const buffer = readFileSync("test.aux.xml");
isAuxXML(buffer);
// true
```

# read aux.xml files
```js
const fs = require("fs");
const readAuxXML = require("aux-xml/read-aux-xml");

const file = readFileSync("test.aux.xml");
const data = readAuxXml(file);
/*
{
  srs: 'PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEO...',
  interleave: 'pixel',
  pyramidResamplingType: 'nearest'
}
*/
```
For  larger example of sample output of readAuxXML see [flower.jpg.aux.xml.json](https://github.com/DanielJDufour/aux-xml/blob/main/data/flower.jpg.aux.xml.json).

# write aux.xml files
```js
const fs = require("fs");
const writeAuxXML = require("aux-xml/write-aux-xml");

const file = readFileSync("test.aux.xml");
const text = writeAuxXML({
  srs: 'PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',
  interleave: 'pixel'
});
```
text will be
```js
`<PAMDataset>
  <SRS>PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]</SRS>
  <Metadata domain="IMAGE_STRUCTURE">
    <MDI key="INTERLEAVE">PIXEL</MDI>
  </Metadata>
</PAMDataset>`
```

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