Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

strxml

mapbox31.6kISC1.0.0

create xml with functions and strings

xml, string, echo, create

readme

Build Status

strxml

Create xml with strings and concatenation.

install

npm install --save strxml

api

  • tag(el, [attributes], contents)
  • tagClose(el, attributes)
  • encode(str)
  • attr(attributes)

example


var tag = require('xmlstr').tag;

tag('Layer',
    tag('StyleName', 'style-' + i) +
    tag('Datasource', {
      name: 'layer-' + i,
      srs: WGS84
    }));