object-to-xml
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "object-to-xml", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Convert any object to XML", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "nodeunit test/test.js" | ||
}, | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -5,1 +5,71 @@ node-object-to-xml | ||
Convert any JavaScript object to XML | ||
install | ||
------- | ||
```bash | ||
npm install object-to-xml | ||
``` | ||
usage | ||
----- | ||
```js | ||
var o2x = require('object-to-xml'); | ||
var obj = { | ||
'?xml version=\"1.0\" encoding=\"iso-8859-1\"?' : null, | ||
request : { | ||
'@' : { | ||
type : 'product', | ||
id : 12344556 | ||
}, | ||
'#' : { | ||
query : { | ||
vendor : 'redhat', | ||
name : 'linux' | ||
} | ||
} | ||
} | ||
}; | ||
console.log(o2x(obj)); | ||
/* | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<request type="product" id="12344556"> | ||
<query> | ||
<vendor>redhat</vendor> | ||
<name>linux</name> | ||
</query> | ||
</request> | ||
*/ | ||
``` | ||
license | ||
------- | ||
### The MIT License (MIT) | ||
Copyright (c) 2013 Daniel L. VerWeire | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
6044
6
111
2
74