xml-get
command line program to get values from xml using lodash.get paths
Last updated 3 months ago by robodo .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install xml-get 
SYNC missed versions from official npm registry.

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>

Current Tags

  • 0.2.5                                ...           latest (3 months ago)

13 Versions

  • 0.2.5                                ...           3 months ago
  • 0.2.4                                ...           3 months ago
  • 0.2.3                                ...           3 months ago
  • 0.2.2                                ...           3 months ago
  • 0.2.1                                ...           3 months ago
  • 0.2.0                                ...           7 months ago
  • 0.1.0                                ...           8 months ago
  • 0.0.6                                ...           8 months ago
  • 0.0.5                                ...           8 months ago
  • 0.0.4                                ...           8 months ago
  • 0.0.3                                ...           8 months ago
  • 0.0.2                                ...           8 months ago
  • 0.0.1                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 13
Dependencies (4)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |