{"name":"xmlbuilder","version":"15.0.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","typings":"./typings/index.d.ts","engines":{"node":">=8.0"},"dependencies":{},"devDependencies":{"coffee-coverage":"*","coffeescript":"2.4.1","coveralls":"*","istanbul":"*","mocha":"*","nyc":"*","xpath":"*","git-state":"*"},"mocha":{"require":["coffeescript/register","coffee-coverage/register-istanbul","test/common.coffee"],"recursive":true,"ui":"tdd","reporter":"dot"},"scripts":{"prepublishOnly":"coffee -co lib src","test":"nyc mocha \"test/**/*.coffee\"","perf":"coffee ./perf/index.coffee"},"gitHead":"08907ea30ff7f07ef1216e90ea38a06fa9bd8c4c","_id":"xmlbuilder@15.0.0","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-KLu/G0DoWhkncQ9eHSI6s0/w+T4TM7rQaLhtCaL6tORv8jFlJPlnGumsgTcGfYeS1qZ/IHqrvDG7zJZ4d7e+nw==","shasum":"de9a078a0b82ef0c6da5c76e58813a879eec31ec","tarball":"http://registry-npm.ywwl.com/xmlbuilder/download/xmlbuilder-15.0.0.tgz","fileCount":49,"unpackedSize":318635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ2k/CRA9TVsSAnZWagAAe6MQAJknhBqiH/FnmmBN5nfQ\nMhGJ0F4hBI2GeLxwUniXqKwJVO34d1ZVLxv5M3CCc8HCTSjFf5u4PEGy4uAL\nbrN7udRMk3zxFOhTleOJeCYtTTMCSfSf2fI1wDUUvWqrkSFJkLxiKupW5eVJ\npddbIJZv/gcD/u+twW7AsrnMHjLhj4btJHiv5Kdivp+etpNXAFKXMESRguPT\nxpvY4ok0z1d/TU6u2lt9W68w3uwaAoSW//m0rj+CWYtm+fwsRCB8r/ajov4f\n9GJty71Gm4nWO4rsnOKANw5DSsLQlBWRlFUY/uOHYlLKLhlOnnuelL33zPHw\n3XrNteMs2Rqeky4sEv6wduYen7WcBjQ2cDxcran/LZ1PGCCoxvptjXDVpRCD\nXSf1H7Ersdu7apUMEm22l+dNj1Q2tEt8ghAcU/sl3PKOyVJ0ezq1yr/gQeZZ\nXsciZhv03OMzWlfO0uGB+rngiicDYPcLZ935UVe19z4+n5rQ6ilOTIctiYcd\n3wH2o1TU2JPJmgZTZZwKbFsXR08b7iiFIM+R3RwqtmGixKte3SCFgrV2LbaC\nYYaHNxmW+40bdYoG7Hes5zrcPOBK/5urKjYLzvmFMqPJzy3A/CDDPr4Yg+an\nNqoVCvH4gnQC+0dty2gGnrL1rxkpgl4UCbhpgPBkPb7RrvMU9Wtch1Z07Apa\nHFHh\r\n=Kl14\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHPcrsRal2Q6cG8liDGpasVAdS0fAEyCc6bklj1uhdGlAiEAxaJ5MqKt2XdUkCLdk/CKz+pkv4NwArkQpj5/UZDNzrg="}],"size":62187,"noattachment":false,"key":"/xmlbuilder/-/xmlbuilder-15.0.0.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_15.0.0_1583835454911_0.33991836173642787"},"_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":1583835455138,"_cnpm_publish_time":1583835455138,"dist-tags":{"latest":"15.1.1"}}