Socket
Socket
Sign inDemoInstall

xml2js

Package Overview
Dependencies
1
Maintainers
0
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.6 to 0.1.7

10

lib/xml2js.js

@@ -1,3 +0,1 @@

require('./proto');
var sax = require('sax'),

@@ -19,9 +17,9 @@ sys = require('sys'),

obj['#'] = "";
if(Object.keys(node.attributes).length) {
node.attributes.forEach( function(v,k) {
for (var key in node.attributes) {
if (node.attributes.hasOwnProperty(key)) {
if(typeof obj['@'] === 'undefined') {
obj['@'] = {};
}
obj['@'][k] = v;
});
obj['@'][key] = node.attributes[key];
}
}

@@ -28,0 +26,0 @@ obj['#name'] = node.name; // need a place to store the node name

34

package.json
{
"name": "xml2js",
"description": "Simple XML to JavaScript object converter.",
"version": "0.1.6",
"author": "maqr <maqr.lollerskates@gmail.com>",
"keywords": ["xml", "json"],
"directories": { "lib": "./lib" },
"main": "./lib/index",
"dependencies" : { "sax" : ">=0.1.1" },
"name" : "xml2js",
"description" : "Simple XML to JavaScript object converter.",
"keywords" : ["xml", "json"],
"homepage" : "https://github.com/Leonidas-from-XIV/node-xml2js",
"version" : "0.1.7",
"author" : "Marek Kubica <marek@xivilization.net> (http://xivilization.net)",
"contributors" : [
"maqr <maqr.lollerskates@gmail.com> (https://github.com/maqr)",
"Ben Weaver (http://benweaver.com/)",
"Jae Kwon (https://github.com/jaekwon)",
"Jim Robert"
],
"main" : "./lib/xml2js",
"directories" : {
"lib": "./lib"
},
"repository" : {
"type": "git",
"url": "https://github.com/Leonidas-from-XIV/node-xml2js.git"
"type" : "git",
"url" : "https://github.com/Leonidas-from-XIV/node-xml2js.git"
},
"dependencies" : {
"sax" : ">=0.1.1"
},
"devDependencies" : {
"zap" : ">=0.2.0"
}
}

@@ -6,6 +6,16 @@ node-xml2js

-----------
Simple XML to JavaScript object converter. Uses [sax-js](http://github.com/isaacs/sax-js/). Install with [npm](http://github.com/isaacs/npm) :)
Simple XML to JavaScript object converter. Uses [sax-js](http://github.com/isaacs/sax-js/).
See the tests for examples until docs are written.
Note: If you're looking for a full DOM parser, you probably want [JSDom](http://github.com/tmpvar/jsdom).
Note: If you're looking for a full DOM parser, you probably want
[JSDom](http://github.com/tmpvar/jsdom).
Installation
------------
Simplest way to install `xml2js` is to use [npm](http://npmjs.org), just `npm
install xml2js` which will download xml2js and all dependencies.
Simple usage

@@ -12,0 +22,0 @@ -----------

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc