Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

viqueen/kingdomjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kingdomjs (v-2.0.0)

Build Status

experimenting with DOM and reflection, alternative fro xml2json conversions.

I also happen to be an expat who sometimes would rather not use xpath.

Installation

npm install kindomjs --save

Usage

let KingDOM = require('kingdomjs');

let atomString = '<entry><id>someId</id><title type="text">some title</title></entry>';
let atomEntry = new KingDOM(atomString).entry[0];

console.log(atomEntry.id[0]['#text']);      // out : someId
console.log(atomEntry.title[0]['#text']);   // out : some title
console.log(atomEntry.title[0]['@type']);   // out : text


// serialize to string
console.log(atomEntry['@toString']);

About

reviving labset/kingdomjs

Resources

Stars

Watchers

Forks

Packages

No packages published