GitXplorerGitXplorer
o

xml-get

public
2 stars
0 forks
4 issues

Commits

List of commits on branch master.
Verified
64a855577d238ab8479231b15d6679dc53ddf0a5

Merge pull request #8 from orangewise/dependabot/npm_and_yarn/path-parse-1.0.7

oorangewise committed 3 years ago
Verified
80ca0a9702da383ec2d8b4df852258f2d85e91ca

Bump path-parse from 1.0.6 to 1.0.7

ddependabot[bot] committed 3 years ago
Unverified
b3ac9117405a0607e885a919f764ccd4a3a434f0

0.2.5

committed 5 years ago
Unverified
722503220a3253300b979d7cf56208661f20cdc7

rename

committed 5 years ago
Unverified
e17f2f9be06805406a35514b3b23bd85f39b85df

0.2.4

committed 5 years ago
Verified
0a5735b06c2d1f250d992f6e61d424f3d9c3ec7d

Merge pull request #2 from orangewise/dependabot/npm_and_yarn/acorn-7.1.1

oorangewise committed 5 years ago

README

The README file for this repository.

xml-get

npm version JavaScript Style Guide

Command line program to get values from xml using lodash.get paths.

usage

Given a the xml file below, you can get values like:

$ 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 version = "1.0" encoding = "utf-8"?>
<root>
    <planes_for_sale>
        <ad>
            <year> 1977 </year>
            <make> &c; </make>
            <model> Skyhawk </model>
            <color> Light blue and white </color>
            <description> New paint, nearly new interior,
                    685 hours SMOH, full IFR King avionics </description>
            <price> 23,495 </price>
            <seller phone = "555-222-3333"> Skyway Aircraft </seller>
            <location>
                <city> Rapid City, </city>
                <state> South Dakota </state>
            </location>
        </ad>
        <ad>
            <year> 1965 </year>
            <make> &p; </make>
            <model> Cherokee </model>
            <color> Gold </color>
            <description> 240 hours SMOH, dual NAVCOMs, DME, 
                        new Cleveland brakes, great shape </description>
            <seller phone = "555-333-2222"  
                    email = "jseller@www.axl.com">
                    John Seller </seller>
            <location>
                <city> St. Joseph, </city>
                <state> Missouri </state>
            </location>
        </ad>
    </planes_for_sale>
</root>