{"_id":"fast-xml-builder@1.3.1","bugs":{"url":"https://github.com/NaturalIntelligence/fast-xml-builder/issues"},"dist":{"shasum":"ef05b353b45597483dfb09d450a062a2baec3a82","tarball":"http://registry-npm.ywwl.com/fast-xml-builder/download/fast-xml-builder-1.3.1.tgz","fileCount":14,"integrity":"sha512-pIM/1n3ntFXKYrUZwW7QCK0gAW7XY+wzj1YMIV3tLDvPj/V+zTGJK5e3/4WJfwj0qWw2ElNXiTixda/R+3YSug==","signatures":[{"sig":"MEQCIGWY5rQCaXAfeO69L+pVgCe3AvoWAIRHXsI8xt2gCYu4AiB3q2RDMqSVumhtlFuiJMRoMfFFQm0v+3h982PCfqqSKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDBIFMw1N5DF7oOIy/h4XTK0SsgLQ+PIYIOLDZ3n3XNggIgEzwSeS6fOjm5GpQsmadkw4LF+7HNuiVh3aO6eRU+q9k="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/fast-xml-builder@1.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":223768,"size":60073,"noattachment":false,"key":"/fast-xml-builder/-/fast-xml-builder-1.3.1.tgz"},"main":"./lib/fxb.cjs","name":"fast-xml-builder","type":"module","types":"./src/fxb.d.ts","author":{"url":"https://solothought.com","name":"Amit Gupta"},"module":"./src/fxb.js","exports":{".":{"import":{"types":"./src/fxb.d.ts","default":"./src/fxb.js"},"require":{"types":"./lib/fxb.d.cts","default":"./lib/fxb.cjs"}}},"funding":[{"url":"https://github.com/sponsors/NaturalIntelligence","type":"github"}],"gitHead":"d7d1d7b7e1ed90474b026d564f3ec7057a35fdec","license":"MIT","scripts":{"lint":"eslint src/**/*.js spec/**/*.js benchmark/**/*.js","test":"c8 --reporter=lcov --reporter=text jasmine spec/*spec.js","unit":"jasmine","bundle":"webpack --config webpack.cjs.config.js","prettier":"prettier --write src/**/*.js","test-types":"tsc --noEmit spec/typings/typings-test.ts"},"version":"1.3.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:498cb49f-5f59-42e7-a482-c428908da76b"}},"homepage":"https://github.com/NaturalIntelligence/fast-xml-builder#readme","keywords":["xml","json","fast","builder","parser","js2xml","json2xml"],"repository":{"url":"git+https://github.com/NaturalIntelligence/fast-xml-builder.git","type":"git"},"_npmVersion":"11.17.0","description":"Build XML from JSON without C/C++ based libraries","directories":{},"maintainers":[{"name":"amitgupta","email":"amitgupta.gwl@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"xml-naming":"^0.3.0","path-expression-matcher":"^1.6.2"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","eslint":"^8.3.0","jasmine":"^5.6.0","webpack":"^5.64.4","prettier":"^3.5.1","typescript":"5","@babel/core":"^7.13.10","@types/node":"20","webpack-cli":"^4.9.1","babel-loader":"^8.2.2","@babel/register":"^7.13.8","fast-xml-parser":"^5.3.9","@babel/preset-env":"^7.13.10","@nodable/entities":"^2.1.0","@babel/plugin-transform-runtime":"^7.13.10"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-xml-builder_1.3.1_1786690958706_0.4965438760830643"},"readme":"# fast-xml-builder\nBuild XML from JSON\n\n[![fast-xml-builder downloads](https://img.shields.io/npm/dw/fast-xml-builder.svg)](https://npm-compare.com/fast-xml-builder) \n[![fast-xml-builder version](https://img.shields.io/npm/v/fast-xml-builder.svg)](https://www.npmjs.com/package/fast-xml-builder)\n[![fast-xml-builder license](https://img.shields.io/npm/l/fast-xml-builder.svg)](https://github.com/NaturalIntelligence/fast-xml-builder)\n\nXML Builder was part of [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) for years. But considering that any bug in the parser may false-alarm users who are only using the builder, we have decided to split it into a separate package.\n\n## Installation\n\n```bash\nnpm install fast-xml-builder\n```\n\n## Usage\n\n```javascript\nimport XMLBuilder from 'fast-xml-builder';\n\nconst builder = new XMLBuilder();\nconst xml = builder.build({ name: 'value' });\n```\n\nfast-xml-builder fully supports the response generated by fast-xml-parser. You can use options like `preserveOrder`, `ignoreAttributes`, `attributeNamePrefix`, `textNodeName`, `cdataPropName`, `commentPropName`, `format`, `indentBy`, `suppressEmptyNode`, `suppressUnpairedNode`, `stopNodes`, `oneListGroup`, `maxNestedTags`, and many more.\n\n## Default Options\n\n```js\n{\n  attributeNamePrefix: '@_',\n  attributesGroupName: false,\n  textNodeName: '#text',\n  ignoreAttributes: true,\n  cdataPropName: false,\n  commentPropName: false,\n  format: false,\n  indentBy: '  ',\n  suppressEmptyNode: false,\n  suppressUnpairedNode: true,\n  suppressBooleanAttributes: true,\n  preserveOrder: false,\n  processEntities: true,\n  unpairedTags: [],\n  stopNodes: [],\n  oneListGroup: false,\n  maxNestedTags: 100,\n  jPath: true,\n  tagValueProcessor: (key, val) => val,\n  attributeValueProcessor: (attrName, val) => val,\n}\n```\n\n## Options Reference\n\nCheck [Options reference](docs/Builder_v1.md) for more detail and examples.\n\n- **arrayNodeName**: When building XML from an array, set `arrayNodeName` to wrap each element in a tag name.\n- **attributeNamePrefix**: Prefix used to identify attribute properties in the JS object. Default: `'@_'`.\n- **attributesGroupName**: Group name for attributes in the JS object. When set, all attributes are expected to be nested under this key. Not supported with `preserveOrder: true`.\n- **attributeValueProcessor**: Customize how attribute values are serialized. Receives the attribute name and value.\n- **cdataPropName**: Property name that identifies CDATA content. Values under this key are wrapped in `<![CDATA[...]]>`.\n- **commentPropName**: Property name that identifies comment content. Values under this key are rendered as `<!-- ... -->`.\n- **format**: By default, output is a single-line XML string. Set `format: true` for human-readable, indented output.\n- **ignoreAttributes**: By default (`true`), attributes are skipped. Set to `false` to include them. Also supports selective ignoring via an array of strings, array of regular expressions, or a callback function.\n- **indentBy**: String used for each level of indentation. Default: `'  '` (two spaces). Only applies when `format: true`.\n- **maxNestedTags**: Limits the maximum depth of nested tags. An error is thrown if this depth is exceeded. Default: `100`.\n- **oneListGroup**: Groups all repeated child tags under a single parent tag.\n- **preserveOrder**: When a JS object was produced by XMLParser with `preserveOrder: true`, pass the same option to XMLBuilder to reconstruct the original XML correctly.\n- **processEntities**: When `true` (default), special characters in text and attribute values are replaced with XML entities (`&amp;`, `&lt;`, etc.). Set to `false` for a performance boost when you know your content has no entities. Note: quotes in attribute values are always escaped regardless of this setting.\n- **stopNodes**: Tags listed here are treated as raw content containers — their text content is written as-is without entity encoding. Accepts an array of tag name strings or `Expression` instances from `path-expression-matcher`. The old `*.tagName` wildcard syntax is still accepted and automatically converted to the equivalent `..tagName` deep-wildcard syntax.\n- **suppressBooleanAttributes**: When `true` (default), attributes with the value `true` are rendered without the value (e.g. `<tag attr>` instead of `<tag attr=\"true\">`).\n- **suppressEmptyNode**: When `true`, tags with no text value are rendered as self-closing (`<tag/>`).\n- **suppressUnpairedNode**: When `true` (default), unpaired tags are rendered without a closing slash (`<br>`). When `false`, they are rendered as `<br/>`.\n- **tagValueProcessor**: Customize how tag text values are serialized. Receives the tag name and value.\n- **textNodeName**: Property name representing the text content of a tag in the JS object. Default: `'#text'`.\n- **unpairedTags**: List of tag names that have no matching closing tag (e.g. `<br>` in HTML).\n","publish_time":1786690958815,"_cnpm_publish_time":1786690958815,"dist-tags":{"latest":"1.3.2"}}