Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2xml

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2xml - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

lib/json2xml.js

@@ -56,2 +56,4 @@ /**

if(typeof node === 'undefined' || null === node) node = '';
if(opts.attributes_key && json[opts.attributes_key]){

@@ -58,0 +60,0 @@ Object.keys(json[opts.attributes_key]).forEach(function(k){

11

package.json
{
"name": "json2xml",
"description": "Simple JavaScript Object to XML string converter.",
"version": "0.1.1",
"homepage": "https://github.com/alanclarke/node-json2xml",
"version": "0.1.2",
"homepage": "https://github.com/estheban/node-json2xml",
"author": {

@@ -46,7 +46,4 @@ "name": "Etienne Lachance",

"readme": "node-json2xml\n===========\n\nDescription\n-----------\n\nSimple JavaScript Object to XML string converter.\n\nInstallation\n------------\n\nSimplest way to install `json2xml` is to use [npm](http://npmjs.org), just `npm\ninstall json2xml` which will download json2xml and all dependencies.\n\nSimple usage\n-----------\n \n var json2xml = require('json2xml');\n json2xml({a:1});\n //<a>1</a>\n\t \n\nOptions\n-----------\n\n\tadd header:\n\n\tjson2xml({a:1}, { header:true });\n\t//<?xml version=\"1.0\" encoding=\"UTF-8\"?><a>1</a>\n\n\tadd node attributes:\n\n\tjson2xml({a:1, attr:{b:2,c:3 }}, { attributes_key:'attr' });\t\n\t// <a b=\"2\" c=\"3\" >1</a>",
"_id": "json2xml@0.1.1",
"dist": {
"shasum": "03d51836b3b3e9a53980132e3a3d07c50bb7d9ec"
},
"_from": "git://github.com/alanclarke/node-json2xml.git"
"_id": "json2xml@0.1.2",
"_from": "git://github.com/estheban/node-json2xml.git"
}

@@ -35,4 +35,6 @@ var json2xml = require('../lib/json2xml.js');

'opts': function(test) {
test.expect(6);
test.expect(8);
test.equal(json2xml({a:''}),'<a/>');
test.equal(json2xml({a:null}),'<a/>');
test.equal(json2xml({a:undefined}),'<a/>');

@@ -45,3 +47,3 @@ test.equal(json2xml({a:1}),'<a>1</a>');

test.equal(json2xml({a:1}, { header:true }),'<?xml version="1.0" encoding="UTF-8"?><a>1</a>');
test.equal(json2xml({a:1, attr:{b:2,c:3 }}, { attributes_key:'attr' }), '<a b="2" c="3">1</a>');
test.equal(json2xml({a:1, attr:{b:2,c:3 }}, { attributes_key:'attr' }), '<a b="2" c="3">1</a>');
test.done();

@@ -48,0 +50,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc