{"_id":"@drftgyhuji7npm/facilis-veniam-sit","name":"@drftgyhuji7npm/facilis-veniam-sit","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@drftgyhuji7npm/facilis-veniam-sit","version":"1.0.0","description":"[![npm downloads](https://img.shields.io/npm/dm/@drftgyhuji7npm/facilis-veniam-sit.svg)](https://www.npmjs.com/package/@drftgyhuji7npm/facilis-veniam-sit)","main":"index.js","author":{"name":"drftgyhuji7"},"license":"MIT","dependencies":{"@drftgyhuji7npm/adipisci-ad-reiciendis-temporibus":"^1.0.0","@drftgyhuji7npm/aliquid-mollitia-est-illo":"^1.0.0","@drftgyhuji7npm/animi-a-ab-earum":"^1.0.0","@drftgyhuji7npm/aut-dolores-numquam-dolorem":"^1.0.0","@drftgyhuji7npm/corporis-facere-ut-suscipit":"^1.0.0","@drftgyhuji7npm/debitis-error-dolores-sit":"^1.0.0","@drftgyhuji7npm/ea-numquam-maiores-voluptas":"^1.0.0","@drftgyhuji7npm/earum-adipisci-error-est":"^1.0.0","@drftgyhuji7npm/esse-eveniet-nobis-dolores":"^1.0.0","@drftgyhuji7npm/impedit-omnis-molestiae-dolores":"^1.0.0","@drftgyhuji7npm/iure-possimus-nihil-tempore":"^1.0.0","@drftgyhuji7npm/laboriosam-molestias-quo-quia":"^1.0.0","@drftgyhuji7npm/magni-eaque-quo-tempore":"^1.0.0","@drftgyhuji7npm/natus-praesentium-nisi-praesentium":"^1.0.0","@drftgyhuji7npm/necessitatibus-necessitatibus-nulla-ducimus":"^1.0.0","@drftgyhuji7npm/nisi-unde-debitis-porro":"^1.0.0","@drftgyhuji7npm/perspiciatis-quis-ducimus-maiores":"^1.0.0","@drftgyhuji7npm/quasi-reprehenderit-dolore-deserunt":"^1.0.0","@drftgyhuji7npm/rem-sint-necessitatibus-possimus":"^1.0.0","@drftgyhuji7npm/repellendus-eum-et-itaque":"^1.0.0","@drftgyhuji7npm/temporibus-omnis-modi-ipsa":"^1.0.0","@drftgyhuji7npm/vitae-rerum-dignissimos-eos":"^1.0.0","@drftgyhuji7npm/voluptas-temporibus-cupiditate-cum":"^1.0.0","@drftgyhuji7npm/voluptatibus-numquam-neque-veritatis":"^1.0.0","@drftgyhuji7npm/voluptatum-molestiae-aliquid-ullam":"^1.0.0","@omegion1npm/quisquam-maiores-provident":"^1.0.0","@povsicoenpm/non-rerum-sequi":"^1.0.0","@rtyughnnpm/eligendi-enim-voluptate":"^1.0.0"},"keywords":["typeof","interrupts","circular","dataview","collection","ast","shell","styles","style","string","sigint","move","sameValueZero","Array.prototype.contains","tacit","color","copy","ECMAScript 2022","animation","isConcatSpreadable","types","ES7","minimal","Object.is","validator","Int16Array","full-width","forms","drag","native","gdpr","tdd","react animation","ECMAScript 5","phone","less mixins","check","rm -fr","lazy","Object.entries","metadata","enumerable","datastructure","directory","Array.prototype.filter","format","promise","dependencies","sigterm","querystring","css less","watchFile","exit","watcher","transpile","validation","korean","define","Observable","preprocessor","stylesheet","positive","harmony","react","date","whatwg","look-up","write","call-bind","value","waapi","get","dependency manager","delete","slot","jsdiff","bootstrap less","wordbreak","chrome","api","es6","dom","mkdir","read","speed","const","a11y","fastify","xhr","slice","ajv","colors","css variable","readablestream","proto","censor","ECMAScript 2020","columns","values","regex",".env","macos","ES2018","sorted","id","rm -rf","trimRight","character","performance","package","-0","once","protocol-buffers","debug","fast-clone","escape","Object.fromEntries","logging","property","website","eventDispatcher","make","loading","styled-components","prefix","invariant","valid","vest","variables in css","jQuery","wordwrap","key","defineProperty","ratelimit","weakmap","ascii","fantasy-land","jsonschema","collection.es6","Uint32Array","Promise","editor","ReactiveX","rate","pose","streams2","error-handling","deep","is","ECMAScript 2023","dom-testing-library","extra","async","eslintconfig","flags","3d","hasOwn","user-streams","js","task","promises","Set","function","clone","fullwidth","find","efficient","sanitization","pnpm9","modules","eslint","default","rapid","opener","WebSocket","open","weakset","bootstrap css","byteLength","scheme","bdd","persistent","events","linewrap","mocha","setPrototypeOf","assert","ES2023","call-bound","push","symbols","yaml","walking","cmd","web","256","ECMAScript 7","spec","chinese","ts","BigInt64Array","styleguide","break","jest","utilities","ECMAScript 2021","point-free","expression","fetch","less","compiler","lint","argument","toStringTag","which","banner","graphql","URLSearchParams","JSON","String.prototype.matchAll","unicode","estree","filter","ECMAScript 3","typeerror","framework","env","StyleSheet","awesomesauce","path","flag","deepclone","typed","less.js","tape","Rx","optimizer","nodejs","classes","react-hook-form","argparse","structuredClone","jwt","getOwnPropertyDescriptor","terminal","offset","dir","japanese","runtime","prototype","extension","typescript","BigUint64Array","redact","higher-order","Observables","ajax","negative","flatten","import","es2016","channel","styling","Reflect.getPrototypeOf","transpiler","dataView","6to5","concat","make dir","workspace:*","String.prototype.trim","libphonenumber","JSON-Schema","findup","eventEmitter","irq","Streams","sanitize","es2017","entries","trimEnd","Object.getPrototypeOf","tc39","three","coercible","postcss","buffers","resolve","util.inspect","create","queueMicrotask","length","utils","time","look","0","package.json","gestures","eslint-plugin","xdg-open","setImmediate","equal","browser","recursive","module","encryption","json-schema-validation","real-time","guid","es2018","extend","set","curl","regular expression","fastclone","pipe","TypedArray","byte","internal slot","side","link","findLast","rgb","client","private data","includes","wget","equality","Map","stream","TypeBox","Uint8Array","pure","callbind","await","package manager","packages","call","auth","utility","windows","CSSStyleDeclaration","mime-db","emit","concatMap","args","getopt","callback","mru","toArray","_.extend","ArrayBuffer#slice","code points","child","buffer","compare","contains","inference","i18n","typedarrays","keys","class-validator","sequence","Object","reduce","RegExp#flags","dotenv","Symbol","search","uninstall","classnames","spinners","connect","names","url","asserts","trimStart","queue","l10n","[[Prototype]]","Array.prototype.flatMap","monorepo","mkdirs","picomatch","groupBy","typedarray","mixins","commander","fast-deep-clone","deepcopy","urls","react pose","stable","io-ts","language","bind","bundler","tools","nope","arktype","flat","limited","polyfill","classname","ReactiveExtensions","typanion","eslintplugin","environment","folder","ie","accessor","hardlinks","last","variables","option","every","busy","core-js","status","signals","typed array","exe","TypeScript","object","var","ES2016","Array.prototype.includes","concurrency","mime","properties","plugin","batch","ArrayBuffer","ES3","parser","handlers","group","Array.prototype.findLast","ArrayBuffer.prototype.slice","Microsoft","ES2015","less compiler","multi-package","chai","writable","up","Iterator","prune","javascript","shared","Uint8ClampedArray","arraybuffer","shrinkwrap","internal","ES5","arrays","rfc4122","lru","mobile","ECMAScript 6","command-line","test","cjk","matches","ES2019","xterm","glob","iteration","AsyncIterator","command","duplex","immer","jsonpath","RegExp.prototype.flags","file system","ponyfill","YAML","form","trim","signal","toSorted","es-shim API","consume","airbnb","streams","cli","ECMAScript 2017","linux","launch","es8","joi","stringifier","exec","ECMAScript 2019","number","map","superagent","traverse","immutable","argv","zod","tester","east-asian-width","config","setter","getintrinsic","jsdom","merge","ecmascript","emoji","Array.prototype.flatten","sham","ramda","telephone","ansi","descriptor","Object.assign","trimLeft","react-hooks","generics","hooks","match","Object.defineProperty","xdg","crypto","cors","json-schema-validator","form-validation","parse","some","reuse"],"repository":{"type":"git","url":"git+https://github.com/drftgyhuji7npm/facilis-veniam-sit.git"},"homepage":"https://github.com/drftgyhuji7npm/facilis-veniam-sit/#readme","bugs":{"url":"https://github.com/drftgyhuji7npm/facilis-veniam-sit/issues"},"packageManager":"yarn@4.1.1","_id":"@drftgyhuji7npm/facilis-veniam-sit@1.0.0","gitHead":"3c9a0bf2662ee58ef105e2cf0720b95da851e4ea","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-PDQ10zYvCBEEvm3B44ZX71lMVnBLov4eWn0+38qigURn3dnrvXDLglvJcookUq/hXVT4kh5afu1Dw9gJ7lHiQw==","shasum":"ce7f92b114a8f545f31cf687bb5f2c96c0f83c19","tarball":"https://registry.npmjs.org/@drftgyhuji7npm/facilis-veniam-sit/-/facilis-veniam-sit-1.0.0.tgz","fileCount":10,"unpackedSize":36420,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCA49CsvBJzTnSrtTFlsl3zJRMVgTFLIce52Mm7i2c/9wIhAJZg2NiwoM7TZqGRdQvOa+h1PjyEsrhbxpGxHBg53eDq"}]},"_npmUser":{"name":"thidong8461","email":"thidong8461@gmail.com"},"directories":{},"maintainers":[{"name":"thidong8461","email":"thidong8461@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/facilis-veniam-sit_1.0.0_1714041005358_0.7135765265879448"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-25T10:30:05.212Z","1.0.0":"2024-04-25T10:30:05.666Z","modified":"2024-04-25T10:30:06.004Z"},"maintainers":[{"name":"thidong8461","email":"thidong8461@gmail.com"}],"description":"[![npm downloads](https://img.shields.io/npm/dm/@drftgyhuji7npm/facilis-veniam-sit.svg)](https://www.npmjs.com/package/@drftgyhuji7npm/facilis-veniam-sit)","homepage":"https://github.com/drftgyhuji7npm/facilis-veniam-sit/#readme","keywords":["typeof","interrupts","circular","dataview","collection","ast","shell","styles","style","string","sigint","move","sameValueZero","Array.prototype.contains","tacit","color","copy","ECMAScript 2022","animation","isConcatSpreadable","types","ES7","minimal","Object.is","validator","Int16Array","full-width","forms","drag","native","gdpr","tdd","react animation","ECMAScript 5","phone","less mixins","check","rm -fr","lazy","Object.entries","metadata","enumerable","datastructure","directory","Array.prototype.filter","format","promise","dependencies","sigterm","querystring","css less","watchFile","exit","watcher","transpile","validation","korean","define","Observable","preprocessor","stylesheet","positive","harmony","react","date","whatwg","look-up","write","call-bind","value","waapi","get","dependency manager","delete","slot","jsdiff","bootstrap less","wordbreak","chrome","api","es6","dom","mkdir","read","speed","const","a11y","fastify","xhr","slice","ajv","colors","css variable","readablestream","proto","censor","ECMAScript 2020","columns","values","regex",".env","macos","ES2018","sorted","id","rm -rf","trimRight","character","performance","package","-0","once","protocol-buffers","debug","fast-clone","escape","Object.fromEntries","logging","property","website","eventDispatcher","make","loading","styled-components","prefix","invariant","valid","vest","variables in css","jQuery","wordwrap","key","defineProperty","ratelimit","weakmap","ascii","fantasy-land","jsonschema","collection.es6","Uint32Array","Promise","editor","ReactiveX","rate","pose","streams2","error-handling","deep","is","ECMAScript 2023","dom-testing-library","extra","async","eslintconfig","flags","3d","hasOwn","user-streams","js","task","promises","Set","function","clone","fullwidth","find","efficient","sanitization","pnpm9","modules","eslint","default","rapid","opener","WebSocket","open","weakset","bootstrap css","byteLength","scheme","bdd","persistent","events","linewrap","mocha","setPrototypeOf","assert","ES2023","call-bound","push","symbols","yaml","walking","cmd","web","256","ECMAScript 7","spec","chinese","ts","BigInt64Array","styleguide","break","jest","utilities","ECMAScript 2021","point-free","expression","fetch","less","compiler","lint","argument","toStringTag","which","banner","graphql","URLSearchParams","JSON","String.prototype.matchAll","unicode","estree","filter","ECMAScript 3","typeerror","framework","env","StyleSheet","awesomesauce","path","flag","deepclone","typed","less.js","tape","Rx","optimizer","nodejs","classes","react-hook-form","argparse","structuredClone","jwt","getOwnPropertyDescriptor","terminal","offset","dir","japanese","runtime","prototype","extension","typescript","BigUint64Array","redact","higher-order","Observables","ajax","negative","flatten","import","es2016","channel","styling","Reflect.getPrototypeOf","transpiler","dataView","6to5","concat","make dir","workspace:*","String.prototype.trim","libphonenumber","JSON-Schema","findup","eventEmitter","irq","Streams","sanitize","es2017","entries","trimEnd","Object.getPrototypeOf","tc39","three","coercible","postcss","buffers","resolve","util.inspect","create","queueMicrotask","length","utils","time","look","0","package.json","gestures","eslint-plugin","xdg-open","setImmediate","equal","browser","recursive","module","encryption","json-schema-validation","real-time","guid","es2018","extend","set","curl","regular expression","fastclone","pipe","TypedArray","byte","internal slot","side","link","findLast","rgb","client","private data","includes","wget","equality","Map","stream","TypeBox","Uint8Array","pure","callbind","await","package manager","packages","call","auth","utility","windows","CSSStyleDeclaration","mime-db","emit","concatMap","args","getopt","callback","mru","toArray","_.extend","ArrayBuffer#slice","code points","child","buffer","compare","contains","inference","i18n","typedarrays","keys","class-validator","sequence","Object","reduce","RegExp#flags","dotenv","Symbol","search","uninstall","classnames","spinners","connect","names","url","asserts","trimStart","queue","l10n","[[Prototype]]","Array.prototype.flatMap","monorepo","mkdirs","picomatch","groupBy","typedarray","mixins","commander","fast-deep-clone","deepcopy","urls","react pose","stable","io-ts","language","bind","bundler","tools","nope","arktype","flat","limited","polyfill","classname","ReactiveExtensions","typanion","eslintplugin","environment","folder","ie","accessor","hardlinks","last","variables","option","every","busy","core-js","status","signals","typed array","exe","TypeScript","object","var","ES2016","Array.prototype.includes","concurrency","mime","properties","plugin","batch","ArrayBuffer","ES3","parser","handlers","group","Array.prototype.findLast","ArrayBuffer.prototype.slice","Microsoft","ES2015","less compiler","multi-package","chai","writable","up","Iterator","prune","javascript","shared","Uint8ClampedArray","arraybuffer","shrinkwrap","internal","ES5","arrays","rfc4122","lru","mobile","ECMAScript 6","command-line","test","cjk","matches","ES2019","xterm","glob","iteration","AsyncIterator","command","duplex","immer","jsonpath","RegExp.prototype.flags","file system","ponyfill","YAML","form","trim","signal","toSorted","es-shim API","consume","airbnb","streams","cli","ECMAScript 2017","linux","launch","es8","joi","stringifier","exec","ECMAScript 2019","number","map","superagent","traverse","immutable","argv","zod","tester","east-asian-width","config","setter","getintrinsic","jsdom","merge","ecmascript","emoji","Array.prototype.flatten","sham","ramda","telephone","ansi","descriptor","Object.assign","trimLeft","react-hooks","generics","hooks","match","Object.defineProperty","xdg","crypto","cors","json-schema-validator","form-validation","parse","some","reuse"],"repository":{"type":"git","url":"git+https://github.com/drftgyhuji7npm/facilis-veniam-sit.git"},"author":{"name":"drftgyhuji7"},"bugs":{"url":"https://github.com/drftgyhuji7npm/facilis-veniam-sit/issues"},"license":"MIT","readme":"# @drftgyhuji7npm/facilis-veniam-sit\n\n[![npm downloads](https://img.shields.io/npm/dm/@drftgyhuji7npm/facilis-veniam-sit.svg)](https://www.npmjs.com/package/@drftgyhuji7npm/facilis-veniam-sit)\n\n### Convert JavaScript objects (and JSON) to XML (for RSS, Podcasts, etc.)\n\nEveryone loves JSON, and more and more folks want to move that direction, but we still need things outputted in XML! Particularly for [RSS feeds](http://www.rssboard.org/rss-specification) and [Podcasts](http://www.apple.com/itunes/podcasts/specs.html).\n\nThis is inspired by [node-jsontoxml](https://github.com/soldair/node-jsontoxml), which was found to be a bit too rough around the edges. @drftgyhuji7npm/facilis-veniam-sit attempts to fix that by being more flexible.\n\n### Installation\n\n-   npm install @drftgyhuji7npm/facilis-veniam-sit\n\n### Simple example\n\n```js\nimport { toXML } from '@drftgyhuji7npm/facilis-veniam-sit';\n\n// toXML(content, config)\nconst content = {\n    a: {\n        foo: 'bar'\n    }\n};\nconst config = {\n    indent: '    '\n};\n\ntoXML(content, config);\n/*\nOutput:\n`<a>\n    <foo>bar</foo>\n</a>`\n*/\n```\n\n### Configuration object options (passed as second parameter to `toXML()`)\n\n| Key name              | Type                | Default                                                      | Description                                                                                                                                                                             |\n| --------------------- | ------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| indent                | `string`            |                                                              | Indent string, repeated n times (where n=tree depth).                                                                                                                                   |\n| header                | `string`, `boolean` |                                                              | Outputs a simple XML 1.0 UTF-8 header when true. Can also be set to a custom string.                                                                                                    |\n| attributeReplacements | `object`            | `{ \"<\": \"&lt;\", \">\": \"&gt;\", \"&\": \"&amp;\", \"\\\"\": \"&quot;\" }` | XML attribute value substrings to replace (e.g. `<a attributeKey=\"attributeValue\" />`). Does not double encode HTML entities (e.g. `&lt;` is preserved and NOT converted to `&amp;lt`). |\n| attributeFilter       | `function`          |                                                              | Filters out attributes based on user-supplied function.                                                                                                                                 |\n| attributeExplicitTrue | `boolean`           | `false`                                                      | When true explicitly outputs `true` attribute value strings, e.g. `<a foo='true' />` instead of `<a foo />`.                                                                            |\n| contentMap            | `function`          |                                                              | Custom map function to transform XML content. Runs after `contentReplacements`.                                                                                                         |\n| contentReplacements   | `object`            | `{ \"<\": \"&lt;\", \">\": \"&gt;\", \"&\": \"&amp;\", \"\\\"\": \"&quot;\" }` | XML content strings to replace (e.g. `<a>This & that</a>` becomes `<a>This &amp; that</a>`).                                                                                            |\n| selfCloseTags         | `boolean`           | `true`                                                       | Whether tags should be self-closing.                                                                                                                                                    |\n\n### Changelog\n\n#### Version 3.2.0\n\n-   new config option `selfCloseTags` added which is used as an easier global setting to enable/disable self-closing tags.\n\n#### Version 3.1.0\n\n-   config option `contentMap` can now be passed to transform any XML content. For instance, if you want `<a>null</a>` to instead appear as `<a></a>` you pass in `contentMap: (content) => { return content === null ? '' : content }`\n-   fixed an issue with improper line breaks and indenting with null content\n\n#### Version 3.0.0\n\n-   **BREAKING CHANGE**: config option `attributesFilter` has been renamed `attributeReplacements`\n-   **BREAKING CHANGE**: config option `filter` has been renamed `contentReplacements`\n-   CDATA blocks are now untouched (no HTML entity replacements) and unindented (#56)\n-   `true` attribute values can now be outputted by setting config option `attributeExplicitTrue: true` (#57)\n-   attributes can now be filtered out by supplying a custom function to the new config option `attributeFilter`. For instance, to remove `null` attribute values from the output, you can supply the config option `attributeFilter: (key, val) => val === null` (#58 and #10)\n-   `devDependencies`: migrated from `babel-eslint` to `@babel/eslint-parser`, migrated from `uglify-es` to `uglify-js`\n\n#### Version 2.2.0\n\n-   Initial support for XML comments ([#47](https://github.com/drftgyhuji7npm/facilis-veniam-sit/issues/47))\n\n#### Version 2.1.1\n\n-   Fix for [#48](https://github.com/drftgyhuji7npm/facilis-veniam-sit/issues/48) (various 0-depth issues, bad \"is output start\" logic)\n\n#### Version 2.0.0 (breaking)\n\n-   New: automatic entity escaping for `&`, `<`, and `>` characters. In addition, quotes `\"` in attributes are also escaped (see [#41](/../../issues/41)). Prior to this, users [had to provide their own filter manually](https://github.com/drftgyhuji7npm/facilis-veniam-sit/issues/4#issuecomment-19165730). Note that `@drftgyhuji7npm/facilis-veniam-sit` makes an effort not to escape entities that appear to have already been encoded, to prevent double-encoding issues.\n    -   E.g. `toXML({ foo: '1 < 2 & 2 > 1' }); // -> \"<foo>1 &lt; 2 &amp; 2 &gt; 1</foo>\"`\n    -   To restore the default behavior from `v1.x.x`, simply pass in `false` to `filter` and `attributesFilter` options:\n        `toXML({ foo: '1 < 2 & 2 > 1' }, { filter: false, attributesFilter: false }); // -> \"<foo>1 < 2 & 2 > 1</foo>\"`\n\nFor more changelog history, see `CHANGELOG.md`.\n\n#### Past changes\n\n-   See CHANGELOG.md for a full history of changes.\n\n### Other Examples\n\nFirst you'll want to require @drftgyhuji7npm/facilis-veniam-sit in your script, and assign the result to the namespace variable you want to use (in this case @drftgyhuji7npm/facilis-veniam-sit):\n\n```javascript\n// Node\nconst { toXML } = require('@drftgyhuji7npm/facilis-veniam-sit');\n\n// Browser (with the help of something like Webpack or Rollup)\nimport { toXML } from '@drftgyhuji7npm/facilis-veniam-sit';\n\n// Browser global fallback (requires no bundler)\nvar toXML = window.@drftgyhuji7npm/facilis-veniam-sit.toXML;\n```\n\n#### Example 1: Simple object\n\n```javascript\ntoXML({\n    foo: 'bar',\n    foo2: 'bar2'\n});\n```\n\nOutput:\n\n```\n<foo>bar</foo><foo2>bar2</foo2>\n```\n\nNote: because JavaScript doesn't allow duplicate key names, only the last defined key will be outputted. If you need duplicate keys, please use an array instead (see Example 2 below).\n\n#### Example 2: Simple array (needed for duplicate keys)\n\n```javascript\ntoXML([\n    {\n        foo: 'bar'\n    },\n    {\n        foo: 'bar2'\n    }\n]);\n```\n\nOutput:\n\n```\n<foo>bar</foo><foo>bar2</foo>\n```\n\n#### Example 3: Simple functions\n\n```javascript\ntoXML({ currentTime: () => new Date() });\n```\n\nOutput:\n\n```\n<currentTime>Mon Oct 02 2017 09:34:54 GMT-0700 (PDT)</currentTime>\n```\n\n#### Example 4: XML tag attributes\n\n```javascript\ntoXML({\n    _name: 'foo',\n    _content: 'bar',\n    _attrs: {\n        a: 'b',\n        c: 'd'\n    }\n});\n```\n\nOutput:\n\n```\n<foo a=\"b\" c=\"d\">bar</foo>\n```\n\n#### Example 5: Tags mixed with text content\n\nTo output text content, set a key to null:\n\n```javascript\ntoXML({\n    text1: null,\n    foo: 'bar',\n    text2: null\n});\n```\n\nOutput:\n\n```\ntext1<foo>bar</foo>text2\n```\n\n#### Example 6: Nested tags (with indenting)\n\n```javascript\nconst xmlOptions = {\n    header: false,\n    indent: '  '\n};\n\ntoXML(\n    {\n        a: {\n            foo: 'bar',\n            foo2: 'bar2'\n        }\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<a>\n  <foo>bar</foo>\n  <foo2>bar2</foo2>\n</a>\n```\n\n#### Example 7: Nested tags with attributes (with indenting)\n\n```javascript\nconst xmlOptions = {\n    header: false,\n    indent: '  '\n};\n\ntoXML(\n    {\n        ooo: {\n            _name: 'foo',\n            _attrs: {\n                a: 'b'\n            },\n            _content: {\n                _name: 'bar',\n                _attrs: {\n                    c: 'd'\n                }\n            }\n        }\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<ooo>\n  <foo a=\"b\">\n    <bar c=\"d\"/>\n  </foo>\n</ooo>\n```\n\nNote that cases like this might be especially hard to read because of the deep nesting, so it's recommend you use something like this pattern instead, which breaks it up into more readable pieces:\n\n```javascript\nconst bar = {\n    _name: 'bar',\n    _attrs: {\n        c: 'd'\n    }\n};\n\nconst foo = {\n    _name: 'foo',\n    _attrs: {\n        a: 'b'\n    },\n    _content: bar\n};\n\nconst xmlOptions = {\n    header: false,\n    indent: '  '\n};\n\nreturn toXML(\n    {\n        ooo: foo\n    },\n    xmlOptions\n);\n```\n\n#### Example 8: Complex functions\n\nFunction outputs will be processed (fed back into toXML), meaning that you can output objects that will in turn be converted to XML.\n\n```javascript\ntoXML({\n    someNestedXML: () => {\n        return {\n            foo: 'bar'\n        };\n    }\n});\n```\n\nOutput:\n\n```\n<someNestedXML><foo>bar</foo></someNestedXML>\n```\n\n#### Example 9: RSS Feed\n\n```javascript\nconst xmlOptions = {\n    header: true,\n    indent: '  '\n};\n\ntoXML(\n    {\n        _name: 'rss',\n        _attrs: {\n            version: '2.0'\n        },\n        _content: {\n            channel: [\n                {\n                    title: 'RSS Example'\n                },\n                {\n                    description: 'Description'\n                },\n                {\n                    link: 'google.com'\n                },\n                {\n                    lastBuildDate: () => new Date()\n                },\n                {\n                    pubDate: () => new Date()\n                },\n                {\n                    language: 'en'\n                },\n                {\n                    item: {\n                        title: 'Item title',\n                        link: 'Item link',\n                        description: 'Item Description',\n                        pubDate: () => new Date()\n                    }\n                },\n                {\n                    item: {\n                        title: 'Item2 title',\n                        link: 'Item2 link',\n                        description: 'Item2 Description',\n                        pubDate: () => new Date()\n                    }\n                }\n            ]\n        }\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\">\n  <channel>\n    <title>RSS Example</title>\n    <description>Description</description>\n    <link>google.com</link>\n    <lastBuildDate>Sat Jul 30 2011 18:14:25 GMT+0900 (JST)</lastBuildDate>\n    <pubDate>Sat Jul 30 2011 18:14:25 GMT+0900 (JST)</pubDate>\n    <language>en</language>\n    <item>\n      <title>Item title</title>\n      <link>Item link</link>\n      <description>Item Description</description>\n      <pubDate>Sat Jul 30 2011 18:33:47 GMT+0900 (JST)</pubDate>\n    </item>\n    <item>\n      <title>Item2 title</title>\n      <link>Item2 link</link>\n      <description>Item2 Description</description>\n      <pubDate>Sat Jul 30 2011 18:33:47 GMT+0900 (JST)</pubDate>\n    </item>\n  </channel>\n</rss>\n```\n\n#### Example 10: Podcast RSS Feed\n\n(see the [Apple docs](http://www.apple.com/itunes/podcasts/specs.html) for more information)\n\n```javascript\nconst xmlOptions = {\n    header: true,\n    indent: '  '\n};\n\ntoXML(\n    {\n        _name: 'rss',\n        _attrs: {\n            'xmlns:itunes': 'http://www.itunes.com/dtds/podcast-1.0.dtd',\n            version: '2.0'\n        },\n        _content: {\n            channel: [\n                {\n                    title: 'Title'\n                },\n                {\n                    link: 'google.com'\n                },\n                {\n                    language: 'en-us'\n                },\n                {\n                    copyright: 'Copyright 2011'\n                },\n                {\n                    'itunes:subtitle': 'Subtitle'\n                },\n                {\n                    'itunes:author': 'Author'\n                },\n                {\n                    'itunes:summary': 'Summary'\n                },\n                {\n                    description: 'Description'\n                },\n                {\n                    'itunes:owner': {\n                        'itunes:name': 'Name',\n                        'itunes:email': 'Email'\n                    }\n                },\n                {\n                    _name: 'itunes:image',\n                    _attrs: {\n                        href: 'image.jpg'\n                    }\n                },\n                {\n                    _name: 'itunes:category',\n                    _attrs: {\n                        text: 'Technology'\n                    },\n                    _content: {\n                        _name: 'itunes:category',\n                        _attrs: {\n                            text: 'Gadgets'\n                        }\n                    }\n                },\n                {\n                    _name: 'itunes:category',\n                    _attrs: {\n                        text: 'TV &amp; Film'\n                    }\n                },\n                {\n                    item: [\n                        {\n                            title: 'Podcast Title'\n                        },\n                        {\n                            'itunes:author': 'Author'\n                        },\n                        {\n                            'itunes:subtitle': 'Subtitle'\n                        },\n                        {\n                            'itunes:summary': 'Summary'\n                        },\n                        {\n                            'itunes:image': 'image.jpg'\n                        },\n                        {\n                            _name: 'enclosure',\n                            _attrs: {\n                                url: 'http://example.com/podcast.m4a',\n                                length: '8727310',\n                                type: 'audio/x-m4a'\n                            }\n                        },\n                        {\n                            guid: 'http://example.com/archive/aae20050615.m4a'\n                        },\n                        {\n                            pubDate: 'Wed, 15 Jun 2011 19:00:00 GMT'\n                        },\n                        {\n                            'itunes:duration': '7:04'\n                        },\n                        {\n                            'itunes:keywords': 'salt, pepper, shaker, exciting'\n                        }\n                    ]\n                },\n                {\n                    item: [\n                        {\n                            title: 'Podcast2 Title'\n                        },\n                        {\n                            'itunes:author': 'Author2'\n                        },\n                        {\n                            'itunes:subtitle': 'Subtitle2'\n                        },\n                        {\n                            'itunes:summary': 'Summary2'\n                        },\n                        {\n                            'itunes:image': 'image2.jpg'\n                        },\n                        {\n                            _name: 'enclosure',\n                            _attrs: {\n                                url: 'http://example.com/podcast2.m4a',\n                                length: '655555',\n                                type: 'audio/x-m4a'\n                            }\n                        },\n                        {\n                            guid: 'http://example.com/archive/aae2.m4a'\n                        },\n                        {\n                            pubDate: 'Wed, 15 Jul 2011 19:00:00 GMT'\n                        },\n                        {\n                            'itunes:duration': '11:20'\n                        },\n                        {\n                            'itunes:keywords': 'foo, bar'\n                        }\n                    ]\n                }\n            ]\n        }\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\" version=\"2.0\">\n  <channel>\n    <title>Title</title>\n    <link>google.com</link>\n    <language>en-us</language>\n    <copyright>Copyright 2011</copyright>\n    <itunes:subtitle>Subtitle</itunes:subtitle>\n    <itunes:author>Author</itunes:author>\n    <itunes:summary>Summary</itunes:summary>\n    <description>Description</description>\n    <itunes:owner>\n      <itunes:name>Name</itunes:name>\n      <itunes:email>Email</itunes:email>\n    </itunes:owner>\n    <itunes:image href=\"image.jpg\"/>\n    <itunes:category text=\"Technology\">\n      <itunes:category text=\"Gadgets\"/>\n    </itunes:category>\n    <itunes:category text=\"TV &amp; Film\"/>\n    <item>\n      <title>Podcast Title</title>\n      <itunes:author>Author</itunes:author>\n      <itunes:subtitle>Subtitle</itunes:subtitle>\n      <itunes:summary>Summary</itunes:summary>\n      <itunes:image>image.jpg</itunes:image>\n      <enclosure url=\"http://example.com/podcast.m4a\" length=\"8727310\" type=\"audio/x-m4a\"/>\n      <guid>http://example.com/archive/aae20050615.m4a</guid>\n      <pubDate>Wed, 15 Jun 2011 19:00:00 GMT</pubDate>\n      <itunes:duration>7:04</itunes:duration>\n      <itunes:keywords>salt, pepper, shaker, exciting</itunes:keywords>\n    </item>\n    <item>\n      <title>Podcast2 Title</title>\n      <itunes:author>Author2</itunes:author>\n      <itunes:subtitle>Subtitle2</itunes:subtitle>\n      <itunes:summary>Summary2</itunes:summary>\n      <itunes:image>image2.jpg</itunes:image>\n      <enclosure url=\"http://example.com/podcast2.m4a\" length=\"655555\" type=\"audio/x-m4a\"/>\n      <guid>http://example.com/archive/aae2.m4a</guid>\n      <pubDate>Wed, 15 Jul 2011 19:00:00 GMT</pubDate>\n      <itunes:duration>11:20</itunes:duration>\n      <itunes:keywords>foo, bar</itunes:keywords>\n    </item>\n  </channel>\n</rss>\n```\n\n#### Example 11: Custom filter for XML entities, or whatever\n\n```javascript\nconst xmlOptions = {\n    contentReplacements: {\n        '<': '&lt;',\n        '>': '&gt;',\n        '\"': '&quot;',\n        \"'\": '&apos;',\n        '&': '&amp;'\n    }\n};\n\ntoXML(\n    {\n        foo: '<a>',\n        bar: '\"b\"',\n        baz: \"'&whee'\"\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<foo>&lt;a&gt;</foo><bar>&quot;b&quot;</bar><baz>&apos;&amp;whee&apos;</baz>\n```\n\n#### Example 11b: Custom filter for XML attributes\n\n```javascript\nconst xmlOptions = {\n    attributeReplacements: {\n        '<': '&lt;',\n        '>': '&gt;',\n        '\"': '&quot;',\n        \"'\": '&apos;',\n        '&': '&amp;'\n    }\n};\n\ntoXML(\n    {\n        _name: 'foo',\n        _attrs: { a: '<\"\\'&\"foo>' }\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<foo a=\"&lt;&quot;&apos;&amp;&quot;foo&gt;\"/>\n```\n\n#### Example 12: Avoiding self-closing tags\n\nIf you don't want self-closing tags, you can pass in a special config option `selfCloseTags`:\n\n```javascript\nconst xmlOptions = {\n    selfCloseTags: false\n};\n\ntoXML(\n    {\n        foo: '',\n        bar: undefined\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<foo></foo><bar>whee</bar>\n```\n\n#### Example 13: Custom XML header\n\n```javascript\nconst xmlOptions = {\n    header: '<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"yes\"?>'\n};\n\ntoXML(\n    {\n        foo: 'bar'\n    },\n    xmlOptions\n);\n```\n\nOutput:\n\n```\n<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"yes\"?><foo>bar</foo><foo2>bar2</foo2>\n```\n\n#### Example 14: Emoji attribute support (needed for AMP)\n\n```javascript\ntoXML({\n    html: {\n        _attrs: {\n            '⚡': true\n        }\n    }\n});\n```\n\nOutput:\n\n```\n<html ⚡/>\n```\n\n#### Example 15: Duplicate attribute key support\n\n```javascript\ntoXML({\n    html: {\n        _attrs: [\n            {\n                lang: 'en'\n            },\n            {\n                lang: 'klingon'\n            }\n        ]\n    }\n});\n```\n\nOutput:\n\n```\n<html lang=\"en\" lang=\"klingon\"/>\n```\n\n#### Example 16: XML comments\n\n```javascript\ntoXML(\n    {\n        _comment: 'Some important comment',\n        a: {\n            b: [1, 2, 3]\n        }\n    },\n    { indent: '    ' }\n);\n```\n\nOutput:\n\n```\n<!-- Some important comment -->\n<a>\n    <b>1</b>\n    <b>2</b>\n    <b>3</b>\n</a>\n```\n\n#### Example 17: Multiple XML comments\n\n```javascript\ntoXML(\n    [\n        { _comment: 'Some important comment' },\n        { _comment: 'This is a very long comment!' },\n        { _comment: 'More important exposition!' },\n        { a: { b: [1, 2, 3] } }\n    ],\n    { indent: '    ' }\n);\n```\n\nOutput:\n\n```\n<!-- Some important comment -->\n<!-- This is a very long comment! -->\n<!-- More important exposition! -->\n<a>\n    <b>1</b>\n    <b>2</b>\n    <b>3</b>\n</a>\n```\n\n### License\n\nMIT\n","readmeFilename":"README.md"}