Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ayn/xmljs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ayn/xmljs

XMLjs is a tiny (1.1kB min/ 615B gzipped) beautiful XML markup generator.

  • 1.0.9
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

XMLjs

Build Status Build Status

XMLjs is a tiny beautiful XML markup generator.

API

const XML = require('@ayn/xmljs')

let doc = new XMLjs()
    .fruits(el=>{
        el.mango({ color: 'green'}, 'This mango is not ripe')
        el.bananas(el=>{
            el.babybanana('Quite small')
            el.plantain('Delicious')
        })
    })
    
console.log(doc.getMarkup())

Simple and elegant. Constructor takes a string as its argument that allows you to set the documents prolog.

Child elements return an object holding information on siblings and its parent, they also have access to the getMarkup() method which returns a subset of the markup.

Output

<fruits>
    <mango color="green">This mango is not ripe</mango>
    <bananas>
        <babybanana>Quite small</babybanana>
        <plantain>Delicious</plantain>
    </bananas>
</fruits>

License

MIT

Keywords

FAQs

Package last updated on 28 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc