You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

xml-get

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-get

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

latest
Source
npmnpm
Version
0.2.5
Version published
Maintainers
1
Created
Source

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>

Keywords

get

FAQs

Package last updated on 15 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts