Socket
Book a DemoInstallSign in
Socket

xml-viewer

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-viewer

Render and interact with XML in the browser

latest
Source
npmnpm
Version
1.3.7
Version published
Maintainers
1
Created
Source

xml-viewer

Render and interact with XML in the browser

Example

view on requirebin

var Viewer = require('xml-viewer');
var fs = require('fs');
var xml = fs.readFileSync(__dirname + '/data.xml');
var insertCSS = require('insert-css');

var view = new Viewer(xml);
view.appendTo(document.body);

view.on('select', function(node){
  if (!node) return console.log('nothing selected');
  console.log('selected:');
  console.log(node);
  console.log(node.text());
});

insertCSS('.selected { background-color: #FFFF91 }');

Installation

$ npm install xml-viewer

License

MIT

FAQs

Package last updated on 05 Oct 2015

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