{"name":"xml-mapping","version":"1.7.2","author":{"name":"Nicolas Thouvenin","email":"nthouvenin@gmail.com"},"contributors":[{"name":"Joe Ibershoff","email":"joe@ibershoff.com","url":"https://github.com/zacronos"},{"name":"Yura Zenevich","email":"yura.zenevich@gmail.com","url":"https://github.com/yzen"},{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"https://github.com/thlorenz"},{"name":"ntgn81","email":"ntgn81@gmail.com","url":"https://github.com/ntgn81"},{"name":"Rowell Cruz","url":"https://github.com/rcruz"},{"name":"JT","url":"https://github.com/spikyjt"}],"description":"provide a bidirectionnal mapping between XML and JS data Structure (aka JSON)","keywords":["xml","json","json2xml","xml2json"],"homepage":"http://github.com/touv/node-xml-mapping","scripts":{"test":"nodeunit test/"},"main":"./lib/xml-mapping.js","repository":{"type":"git","url":"git+https://github.com/touv/node-xml-mapping.git"},"dependencies":{"xml-writer":">=1.7.0","sax":"=0.4.3"},"devDependencies":{"nodeunit":">=0.7.3"},"license":"MIT","engines":{"node":">=0.2.0"},"gitHead":"2816ef9cb58c8ce2ac09cf1017b1d9cdba49117a","bugs":{"url":"https://github.com/touv/node-xml-mapping/issues"},"_id":"xml-mapping@1.7.2","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-r6HWaifjTUZPGUj/MI006DKpbItA3EsbhXQw30KX8QkyU/+CfNKxEMuHjqxdapzdl5zbYQPebUUZPhZyvDA1+w==","shasum":"b59c63dc1560b42d9ae9648ae3d1b508e27dbd04","tarball":"http://registry-npm.ywwl.com/xml-mapping/download/xml-mapping-1.7.2.tgz","fileCount":21,"unpackedSize":51174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9/KXCRA9TVsSAnZWagAAOYoQAJa/RtreZZR3Nsw6K9GT\nwAiY6TzrT8smPWKheNZqhHyBFdCu8U+crdW0jUPspUxff0R3N/s+WfmGjg8B\neeTp0dkVIZI+fsK203wWSstpCFQ0QyaM4qUWW+okpRG0z3KNCzEzc0IIZ8+x\nENzuxPy8ZrrS/+YWTVQ3MWLpgQ9gZ9atj/bUop7AaPdZXoiij6I4IRfO3eSH\nw2D3trwMxXUFhEQhQBBz8fPFQ+jCICbad1uZJ8QBylgCO0kC4rtFQ4/98V0J\nK+3mI2kHJuLDu6qRjQFJt/B0TuzY2HAADOHLnzA+KRb+Vr36k2DODbCmDFHz\nrcSp7ojlNPL/A9+tP+3RlAVGTJyB7zVE3tyCqx5Ncu+cO7cuQZdb34V+qOLd\nyd4eRLF0bmv/1/cw0hy4v2LU0d6GaNoFBT3O5XdyDM+46BqCWnHdXFxjM53U\nP4XPLI9KkALSKVG3iKDOXoyRXdS6qFN7kOS0BpgZIk8Rp32yvQQQbjTf+vtu\n3ptE8ihp3tJJBkLQC6Cn6NYdVfYdWa9M/PMuthfyvUmWSPugrHDRxecJUqlu\nOY+xPUP+Oq0V1jE2kZUvuHSUnUCokWVRFNfn/YTsxXsMI7J1cQkupKiDp5V4\nKfgzmHh+bOALlct+lAwJJcJG4PTeWz4Iyvn/Xu71nYF3MMPgoa+HtmT1GIQy\nvuE8\r\n=tyR0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZYWcPXVyRChQ5V9ACt7C+N8N/R7ALizRFCPjj9Hl/bQIgAf47h3kzQCUvieKRRoTGo1u1GL5adFIUydYzVhdW1MI="}],"size":12085,"noattachment":false,"key":"/xml-mapping/-/xml-mapping-1.7.2.tgz"},"_npmUser":{"name":"touv","email":"nthouvenin@gmail.com"},"directories":{},"maintainers":[{"name":"touv","email":"nthouvenin@gmail.com"},{"name":"niederlec","email":"claude.niederlender@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xml-mapping_1.7.2_1643639447260_0.9895180483069452"},"_hasShrinkwrap":false,"readme":"# xml2json and json2xml for NodeJS\n\n[![Build Status](https://secure.travis-ci.org/Inist-CNRS/node-xml-mapping.png?branch=master)](http://travis-ci.org/Inist-CNRS/node-xml-mapping)\n\nIt's native javascript implementation of a bidirectional converter between XML and JS data structure (aka JSON).\nYou can convert any type of XML documents in an Javascript data structure.\nYou can also do the reverse, converting a Javascript data structure in XML String. XML is still valid.\n\n## Contributors\n\n  * [Nicolas Thouvenin](https://github.com/touv)\n  * [Joe Ibershoff](https://github.com/zacronos)\n  * [Yura Zenevich](https://github.com/yzen)\n  * [Thorsten Lorenz](https://github.com/thlorenz)\n  * [ntgn81](https://github.com/ntgn81)\n  * [Rowell Cruz](https://github.com/rcruz)\n  * [JT](https://github.com/spikyjt)\n  * [Bindu Wavell](https://github.com/binduwavell)\n  * [niederlec](https://github.com/niederlec)\n\n# Installation\n\nWith [npm](http://npmjs.org) do:\n\n    $ npm install xml-mapping\n\n\n# Usage\n```javascript\nvar XMLMapping = require('xml-mapping');\n\nvar json = XMLMapping.load('<key>value</key>');\nvar xml  = XMLMapping.dump(json);\n\nconsole.log(xml,json);\nconsole.log(json);\n```\n\nOutput:\n\n    <key>value</key> { key: { '$t': 'value' } }\n\n# Convention\n\nThe rules for converting XML to JSON are those used by Google in its GData protocol. More information here : http://code.google.com/apis/gdata/docs/json.html\n\n# Tests\n\nUse [nodeunit](https://github.com/caolan/nodeunit) to run the tests.\n\n    $ npm install nodeunit\n    $ nodeunit test\n\n# API Documentation\n\n## load(String xml, Object options)\nTransform a string with XML in Javascript data structure (JSON).\n**Return Object.**\n\n###Options\n\n**Warning : options break the symmetry. This means that the JSON generated may not reproduce the same XML**\n\n* `throwErrors` - *boolean* - Flag to throw errors of the SAX Parser ; *default : false*\n* `nested` - *boolean* - Flag to ignore nested tags inside text : *default : false*\n* `specialChar` - *string* - Set the first character of XML tag ($t, $text, $cd, $cdata, $e, $element, $c, $comment); *default : $*\n* `longTag` - *boolean* - Use long names tags($text, $element, $cdata, $comment) rather than short names ($t, $cd, $e, $c); *default : false*\n* `comments` - *boolean* - Flag to ignore comments, if false all the comments will be ignored : *default : true*\n* `parserInfos` - *boolean* - Flag to add some attributes generated by the parser (order, line, column, name), if true informations are inserted in the attributes list of all tags : *default : false*\n\n```javascript\nvar xml = '<title>Title is <strong>important</strong></title>';\nvar json = XMLMapping.load(xml, { nested: true });\nconsole.log(json);\n\n// Should output:\n// { title : { $t : 'Title is<strong>important</strong>', strong: { '$t': 'important' }} }\n```\n\n* `arrays` - *array* - an array of basic XPath strings that specify XML nodes that should be array, even when there is only one such node.\n\n```javascript\nvar xml = '<key1>value1</key1><key2><key3>value3</key3></key2>';\nvar json = XMLMapping.load(xml, {\n arrays: [\n  '/key1',\n  '/key2/key3'\n ]\n});\nconsole.log(json);\n\n// Should output:\n// (Note that value of key1 and key3 are arrays, as specified in options)\n// {\"key1\":[{\"$t\":\"value1\"}],\"key2\":{\"key3\":[{\"$t\":\"value3\"}]}}\n```\n\n\n## dump(Object json, Object options)\nTransform a Javascript data structure (JSON) in XML string. **Return String.**\n\n###Options\n\n**Warning : options break the symmetry. This means that the XML generated may not reproduce the same JSON**\n\n* `indent` - *boolean* - Flag to throw errors of the SAX Parser ; *default : false*\n* `header` - *boolean* - Flag to add XML header; *default : false*\n* `version` - *string* - Set version attribute of XML header (see header flag); *default : 1.0*\n* `encoding` - *string* - Set encoding attribute of XML header (see header flag); *default : UTF-8*\n* `specialChar` - *string* - Set the first character of XML tag ($t, $text, $cd, $cdata, $e, $element, $c, $comment); *default : $*\n\n\n## tojson(String xml)\nAlias of load.\n\n## toxml(Object json)\nAlias of dump.\n\n# Also\n\n* https://github.com/estheban/node-json2xml\n* https://github.com/buglabs/node-xml2json\n\n# License\n\n[MIT/X11](https://raw.github.com/touv/node-xml-mapping/master/LICENSE)\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/touv/node-xml-mapping/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","publish_time":1643639447385,"_cnpm_publish_time":1643639447385,"dist-tags":{"latest":"1.7.2"}}