{"name":"xmlbuilder","version":"13.0.2","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","typings":"./typings/index.d.ts","engines":{"node":">=6.0"},"dependencies":{},"devDependencies":{"coffee-coverage":"*","coffeescript":"*","coveralls":"*","mocha":"*","nyc":"*","xpath":"*"},"scripts":{"prepublishOnly":"coffee -co lib src","test":"nyc mocha \"test/**/*.coffee\""},"gitHead":"b7d953fe88d35bba0fa5d8fd7a14769dc1863137","_id":"xmlbuilder@13.0.2","_nodeVersion":"10.14.2","_npmVersion":"6.8.0","dist":{"integrity":"sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ==","shasum":"02ae33614b6a047d1c32b5389c1fdacb2bce47a7","tarball":"http://registry-npm.ywwl.com/xmlbuilder/download/xmlbuilder-13.0.2.tgz","fileCount":45,"unpackedSize":241508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5O8aCRA9TVsSAnZWagAA8DIP/014PmMmS06LmMTRs4lG\nCDOsSQzRj0oo4vsoD7d74QfYEWbNHlwr3RVH/xLVS3aCWvhpC/kmEEUM+MXg\ncVO1t81l0aP/EG9oqAVh1jrg3plJVA1ZUvyfD5LsfiynyZDokcKYLQG/13Bb\nakuPhTA+tUuZGo8yv3r8CrLGP7kCze1uZxQHMl5GRvDuQ3lx+Kp8/4LDiCTo\nVSYXSIR9mXB5GQLbc9FQxTWSuGwryVe8QrPD5vMEhkucs9xhIyl0QtmEamqw\nvSR4V0SBqKmnxOqENMFTAIAa21wnbfI8Vlg3jYj/v+84wPpex8fgGZ26P+K8\ndlPzN1zdF6vdOgO+4dbYdnUEWQEQI174sF6tsizJjzpC9OMaCcC+6iQLu5G/\nQktimC9YAqH6Y3JBLltULIEe2F2f0U6Qw7d5vB2ixAkPMYIvheE01hJG+gxT\nV0VFtbfbVAqxkpyS4Yg4EH5oz7wc6rwQIlt+BI3hCk9eZLuCB54GXZfCBr1V\nAS9++58vcMWuXUhDytf5JS4iNX00K3s+p6P534LE6XSENusPESRRYen0flWx\nFwQLN1w5Dz536+IlJsoY+CntRj3HxKrHJRkGrll69+2xWjmOjTauAgb6oBfD\n00PvqcAIsr3tpR7iHDjz2lf9ymVUo3IRJx6Szl2cDIqKDkkpdXx6Q6kycydg\nwC0N\r\n=PK08\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwqUrglViBQwN5ba66doKPvJAKcnlfGw8rxJxwVezsIAiEArpnYPpZyWPzn/0aEMNmCCBM7EhzZ8TYd7h/9zQ2g78E="}],"size":40333,"noattachment":false,"key":"/xmlbuilder/-/xmlbuilder-13.0.2.tgz"},"maintainers":[{"name":"oozcitak","email":"oozcitak@gmail.com"}],"_npmUser":{"name":"oozcitak","email":"oozcitak@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xmlbuilder_13.0.2_1558507289376_0.9117501020278709"},"_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":1558507289565,"_cnpm_publish_time":1558507289565,"dist-tags":{"latest":"15.1.1"}}