New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jsxmlparser

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsxmlparser

jsxmlparser

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Project jsxmlparser

Syncronously

  const obj = toObject('<div style="Jepa">Hello World!!!</div>')
  console.log(obj)

Step by Step

  const parser = new XMLParser(['<div style="Jepa">Hello World!!!</div>'])
  let max_cnt = 100000
  while(!parser.eof) {
    parser.parse({
      beginNode( name:string, buffer_index?:number ) {
        console.log('Begin ', name)
      },
      setAttribute( name:string, value:bufferType, buffer_index?:number) {
        console.log('attr ', name, '=', value)
      },
      addTextNode( value:string, buffer_index?:number ) {
        console.log('test: ', value)
      },
      closeNode( name:string, buffer_index?:number ) {
        console.log('closed: ', name)
      }        
    })
    if(max_cnt-- < 0 ) break
  }

Next Version

Use this kind of API

https://docs.oracle.com/javase/tutorial/jaxp/stax/api.html

FAQs

Package last updated on 17 Aug 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