{"name":"xmlbuilder","version":"10.1.0","keywords":["xml","xmlbuilder"],"homepage":"http://github.com/oozcitak/xmlbuilder-js","description":"An XML builder for node.js","author":{"name":"Ozgur Ozcitak","email":"oozcitak@gmail.com"},"contributors":[],"license":"MIT","repository":{"type":"git","url":"git://github.com/oozcitak/xmlbuilder-js.git"},"bugs":{"url":"http://github.com/oozcitak/xmlbuilder-js/issues"},"main":"./lib/index","engines":{"node":">=4.0"},"dependencies":{},"devDependencies":{"coffeescript":"1.*","mocha":"*","coffee-coverage":"2.*","istanbul":"*","coveralls":"*"},"scripts":{"prepublishOnly":"coffee -co lib src","postpublish":"rm -rf lib","test":"mocha \"test/**/*.coffee\" && istanbul report text lcov"},"gitHead":"9a2bf45179290a71fbb51d5f0fa8d5797c7a7238","_id":"xmlbuilder@10.1.0","_npmVersion":"6.0.0","_nodeVersion":"8.11.1","_npmUser":{"name":"oozcitak","email":"oozcitak@gmail.com"},"dist":{"integrity":"sha512-In21jFWiaulS7Cmw1fPT1Lm7g7L6ml/uwZNAaKlDZc78szm3pn5oH9gizH7sh1h2GGRb3OkL5kLCeMEENEnZwA==","shasum":"62418e950123398140db8150e6e4019329cf3fe4","tarball":"http://registry-npm.ywwl.com/xmlbuilder/download/xmlbuilder-10.1.0.tgz","fileCount":28,"unpackedSize":109828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvghsCRA9TVsSAnZWagAAL2AP/2oZDcui+0i1zDVQKMPW\naAcJmUE3LnJpEAvHYiDuh5A1Q+kIPM83CvkJgkC91UcHPYJLZcCcwxhXoSBJ\nTp7u3iqDmfM+2eQog+TElLCF5OUGfIC/zDw6wapHF7naHEw8x7FR9eV4+iuy\nIruGfgmEaG4iGXJmibpfHWdYn4plv1F5Ne1RT7CObQh3zLVqNOukn0ie8ukh\n92wWKmPq7u70yVW9EU+rEQD2DuBQ84WvPDkzy/NLXYZ+hLFH8Z62SpN3900a\nVGnNCh3nHSkFMstUOXIwbzkaZcKdzJnip/01/6CUdx4Uj8gYwLx8zFdxqjM1\nQxJodOzA9BETsKI9OPgTN7tnORsvRuONCUHTaBAWi0sEAtEDxZNRl4d+1eP4\n1WH7Pkxbtoqzbfnbx/bZ09JiJBrjIdoZFaNb7SIH5lmum6XwIyjfrtuXMFL4\nL6aM0XaOLdTochXfOVvlLmNRun6kJkTK9HBSDDRRjm9TWsGz+nGdMjbp4o9r\nLo2qoSBbgHx+YypvCOlJaXQ/xJGhmBRlACqiTgw/qJMFs7VSD/eSrFuXwbLB\nCVvrHT5M8ziM08dMzzWHrhg/suhLrMh2F5xZE5BrgBct4oywdu53z463enGt\naqYLRnmk4111G36Z/bljK98Wp+x8xc2nEp9kRcb30HINU7bduBdzbhvi4Aun\nX3r/\r\n=/2kR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICRYrzARKci6dpBoJV+Nw50uYF3n0DGy4VawOptWlrWxAiEAlZ5N+eNferfqzIMPW8vUweumee31B+zDNeWvY7fpup0="}],"size":19422,"noattachment":false,"key":"/xmlbuilder/-/xmlbuilder-10.1.0.tgz"},"maintainers":[{"name":"oozcitak","email":"oozcitak@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xmlbuilder_10.1.0_1539180651890_0.8455846131751434"},"_hasShrinkwrap":false,"readme":"# xmlbuilder-js\r\n\r\nAn XML builder for [node.js](https://nodejs.org/) similar to\r\n[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder).\r\n\r\n[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT)\r\n[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)\r\n[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)\r\n\r\n[![Travis Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js)\r\n[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/bf7odb20hj77isry?svg=true)](https://ci.appveyor.com/project/oozcitak/xmlbuilder-js)\r\n[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js)\r\n[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js)\r\n\r\n### Announcing `xmlbuilder2`:\r\n\r\nThe new release of `xmlbuilder` is available at [`xmlbuilder2`](https://github.com/oozcitak/xmlbuilder2)! `xmlbuilder2` has been redesigned from the ground up to be fully conforming to the [modern DOM specification](https://dom.spec.whatwg.org). It supports XML namespaces, provides built-in converters for multiple formats, collection functions, and more. Please see [upgrading from xmlbuilder](https://oozcitak.github.io/xmlbuilder2/upgrading-from-xmlbuilder.html) in the wiki.\r\n\r\nNew development will be focused towards `xmlbuilder2`; `xmlbuilder` will only receive critical bug fixes.\r\n\r\n### Installation:\r\n\r\n``` sh\r\nnpm install xmlbuilder\r\n```\r\n\r\n### Usage:\r\n\r\n``` js\r\nvar builder = require('xmlbuilder');\r\n\r\nvar xml = builder.create('root')\r\n  .ele('xmlbuilder')\r\n    .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git')\r\n  .end({ pretty: true});\r\n\r\nconsole.log(xml);\r\n```\r\n\r\nwill result in:\r\n\r\n``` xml\r\n<?xml version=\"1.0\"?>\r\n<root>\r\n  <xmlbuilder>\r\n    <repo type=\"git\">git://github.com/oozcitak/xmlbuilder-js.git</repo>\r\n  </xmlbuilder>\r\n</root>\r\n```\r\n\r\nIt is also possible to convert objects into nodes:\r\n\r\n``` js\r\nvar builder = require('xmlbuilder');\r\n\r\nvar obj = {\r\n  root: {\r\n    xmlbuilder: {\r\n      repo: {\r\n        '@type': 'git', // attributes start with @\r\n        '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node\r\n      }\r\n    }\r\n  }\r\n};\r\n\r\nvar xml = builder.create(obj).end({ pretty: true});\r\nconsole.log(xml);\r\n```\r\n\r\nIf you need to do some processing:\r\n\r\n``` js\r\nvar builder = require('xmlbuilder');\r\n\r\nvar root = builder.create('squares');\r\nroot.com('f(x) = x^2');\r\nfor(var i = 1; i <= 5; i++)\r\n{\r\n  var item = root.ele('data');\r\n  item.att('x', i);\r\n  item.att('y', i * i);\r\n}\r\n\r\nvar xml = root.end({ pretty: true});\r\nconsole.log(xml);\r\n```\r\n\r\nThis will result in:\r\n\r\n``` xml\r\n<?xml version=\"1.0\"?>\r\n<squares>\r\n  <!-- f(x) = x^2 -->\r\n  <data x=\"1\" y=\"1\"/>\r\n  <data x=\"2\" y=\"4\"/>\r\n  <data x=\"3\" y=\"9\"/>\r\n  <data x=\"4\" y=\"16\"/>\r\n  <data x=\"5\" y=\"25\"/>\r\n</squares>\r\n```\r\n\r\nSee the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples.\r\n","publish_time":1539180652173,"_cnpm_publish_time":1539180652173,"dist-tags":{"latest":"15.1.1"}}