hyper-xml

0.1.1 • Public • Published

hyper-xml

A DSL to create JSON trees compatible with xml-reader. Tries to comply with the h2spec.

npm version build status ISC-licensed chat on gitter

Installing

npm install hyper-xml

Usage

const h = require('hyper-xml')
 
const one = h('one', {a1: 'v1'}, [
    h('two', [
        h('three', {a2: 'v2', a3: 'v3'}),
        'four'
    ])
])

one will look like this:

{
    type: 'element',
    name: 'one',
    attributes: {a1: 'v1'},
    children: [{
        type: 'element',
        name: 'two',
        children: [{
            type: 'element',
            name: 'three',
            attributes: {a2: 'v2', a3: 'v3'}
        }, {
            type: 'text',
            value: 'four'
        }]
    }]
}

Contributing

If you have a question or have difficulties using hyper-xml, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i hyper-xml

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • derhuerst