New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

libxmljs-lazy-builder

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

libxmljs-lazy-builder

Builds XML documents in a lazy way.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

libxmljs-lazy-builder

Builds XML documents in a lazy way.

SYNOPSIS

const E = require('libxmljs-lazy-builder')

const doc = new E.libxml.Document()
const elem = E("root", {},
             E("kit", {color: "brown"}),
             "mars",
             E("kat"))(doc)

elem.toString()
   // => '<root><kit color="brown"/>mars<kat/></root>'

INSTALLATION

npm install libxmljs-lazy-builder --save

DESCRIPTION

API

E (name, {attrName: value, ...}, children, ...)

(You can name it arbitrarily.) This function generates a function which takes a libxml.Document object and returns a libxml.Element object.

A child can be a string or an another E() element. You can specify zero or more children.

Please note that you need to call the returned value from E() with a Document object to get an actual Element object. So, the whole structure should be something like:

const doc = new E.libxml.Document()
const elem = E("x", {}, E("y", {}, ...), ...)(doc)
E.libxml

The libxml module used internally in E. Use this to create a Document object.

Examples

Please see the test script in the repository.

DEPENDS ON

libxmljs

LICENSE

MIT

AUTHOR

Toru Hisai @torus

Keywords

FAQs

Package last updated on 17 May 2018

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