crack

Really simple XML parsing

npm install crack
8 downloads in the last day
39 downloads in the last week
47 downloads in the last month

Crack

Build Status

Really simple XML parsing with libxmljs.

Installation

npm install crack

Usage

crack = require 'crack'

data = '<?xml version="1.0" encoding="UTF-8"?>' +
       '<Items>' +
       '<Item>' +
       '<ASIN>0816614024</ASIN>' +
       '<ItemAttributes>' +
       '<Creator Role="Author">Gilles Deleuze</Creator>' +
       '<Creator Role="Contributor">Felix Guattari</Creator>' +
       '<Title>Thousand Plateaus</Title>' +
       '</ItemAttributes>' +
       '</Item>' +
       '</Items>'
doc = crack data

# Convert entire document to a JavaScript object.
console.dir doc.toJS()

# Drop down to a node.
doc.find 'Creator', (creator) ->
  console.dir creator
npm loves you