Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orangewise/xml-get
get values from xml
https://github.com/orangewise/xml-get
cli get lodash npm xml
Last synced: 8 days ago
JSON representation
get values from xml
- Host: GitHub
- URL: https://github.com/orangewise/xml-get
- Owner: orangewise
- Created: 2019-09-28T11:59:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T14:43:39.000Z (almost 3 years ago)
- Last Synced: 2024-10-01T06:44:56.135Z (about 2 months ago)
- Topics: cli, get, lodash, npm, xml
- Language: JavaScript
- Size: 63.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# xml-get
[![npm version][npm-badge]][npm-url]
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)Command line program to get values from xml using lodash.get paths.
# usage
Given a the xml file below, you can get values like:
```bash
$ npx xml-get planes_for_sale.ad[0].year ./test/fixtures/one.xml
1977# output json, can be piped into jq
$ npx xml-get planes_for_sale.ad[0].year ./test/fixtures/one.xml json | jq .
"1977"$ npx xml-get planes_for_sale.ad[1].location.state ./test/fixtures/one.xml
Missouri$ cat ./test/fixtures/one.xml | npx xml-get planes_for_sale.ad[0].color
Light blue and white
```## xml file
```xml
1977
&c;
Skyhawk
Light blue and white
New paint, nearly new interior,
685 hours SMOH, full IFR King avionics
23,495
Skyway Aircraft
Rapid City,
South Dakota
1965
&p;
Cherokee
Gold
240 hours SMOH, dual NAVCOMs, DME,
new Cleveland brakes, great shape
John Seller
St. Joseph,
Missouri
```
[npm-badge]: https://badge.fury.io/js/xml-get.svg
[npm-url]: https://badge.fury.io/js/xml-get