Class: Parser

Parser(options)

Core parser for nmap xml log files

Constructor

new Parser(options)

Parameters:
Name Type Description
options Object Parser options
Source:

Extends

Members

(readonly) autoParse :Boolean

Current `options.autoParse` value
Type:
  • Boolean
Source:

autoParse

Set current `options.autoParse` value
Source:

lastError :Error

The last generated error by this or it's children
Type:
  • Error
Source:

lastWarning :String

The last generated warning by this or it's children
Type:
  • String
Source:

logData :String

File data for the current log being parsed, cleared after processing
Type:
  • String
Source:

(readonly) logPath :String

Current `options.logPath` value
Type:
  • String
Source:

logPath

Set current `options.logPath` value and start processing if required
Source:

logStruct :Object

XML structure generated by XmlParser, cleared after processing
Type:
  • Object
Source:

(readonly) newestScan :Scan

Pull latest scan from the array of processed log files
Type:
Source:

options :Object

Merge default options with given options
Type:
  • Object
Source:

(readonly) scanCount :Scan

How many scans are currently in memory
Type:
Source:

scans :Array

An array of previous parsed log files, cleared if `retainParsedLogs` is false
Type:
  • Array
Source:

Methods

clearLogs()

Clear log cache
Source:

(async) startParse()

Begins processing the log file specified at `options.logPath` Return will be false if an error occured
Source:
Returns:

throwDebug(debugText)

Emits a debug message to any listeners, calls the `onDebug` function if set
Parameters:
Name Type Description
debugText String Debug message text value
Overrides:
Source:

throwError(errText) → {Boolean}

Emits an error to any listeners, calls the `onError` function if set
Parameters:
Name Type Description
errText String Error message text value
Overrides:
Source:
Returns:
Type
Boolean

throwWarning(warnText)

Emits a warning to any listeners, calls the `onWarning` function if set
Parameters:
Name Type Description
warnText String Warning message text value
Overrides:
Source: