0.2.5 • Published 4 years ago

xml-get v0.2.5

Weekly downloads
109
License
ISC
Repository
github
Last release
4 years ago

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>
0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

1.0.0

8 years ago