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

@lite-js/xml

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lite-js/xml

Maintaining XML in Pure Javascript (IN BOTH NODE.JS & BROWSERS)

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

xml

npm version Build Status Coverage Status

Maintaining XML in pure javascript (IN BOTH NODE.JS & BROWSERS) Homepage

Maintaining?

Converting

converting

Editing/Traversing

XMLLite.findChildNode(doc, query);
XMLLite.findChildNodes(doc, query);
XMLLite.findOrCreateChildNode(doc, query);
XMLLite.removeChildNode(doc, query);
XMLLite.eachChildNode(doc, query, callback);
// ...

Formatting

XMLLite.beautify(xml, indent);
XMLLite.uglify(xml, preserveComments);
XMLLite.sanitize(xml, reverse);
// ...

Actually, you can get the js object from XMLLite.xml2js(xml), do whatever you want, and convert it back to xml again with XMLLite.js2xml(obj).

Why?

  1. A reasonable need for usage in both Node.js and Browsers
  2. A more reasonable need to use native APIs(DOMParser/XMLSerializer) to speed up the maintaining process and keep the library thin

Why @lite-js/xml?

  1. It works exactly the same in both Node.js and Browsers
  2. The browser version is supper light-weight(dist/xml.js)
  3. Convenient APIs for converting between xml/js/json/DOM, and lots of helpers to maintain the data structures
  4. Super fast. it takes less than 30ms to convert an xml document with over 1,000 nodes into a js object

Install

$ npm install @lite-js/xml --save
$ npm install @lite-js/xml -g

Usage

In Node.js

const XML = require('@lite-js/xml');

Command line client

$ xml-lite --help

In browsers

<script src="$path/to/@lite-js/xml/dist/xml.js"> <!-- window.XML is available -->

In browsers with webpack

import XMLLite from '@lite-js/xml/indexBrowser';

Demo

API

JSON spec

Projects using @lite-js/xml

Contributing

known issues

Keywords

FAQs

Package last updated on 25 Jul 2017

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