
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
fontoxpath
Advanced tools
A minimalistic XPath 3.1 selector engine for (XML) nodes.
const { evaluateXPathToBoolean } = require('fontoxpath');
const documentNode = new DOMParser().parseFromString('<xml/>', 'text/xml');
console.log(evaluateXPathToBoolean('/xml => exists()', documentNode)); // => true
FontoXPath supplies a number of API functions:
evaluateXPath.*
functions:
evaluateXPath(xpath: string, contextNode: Node, domFacade: ?DomFacade=, variables: Object={}, returnType: number) => *
evaluateXPathToNodes(xpath: string, contextNode: Node, domFacade: ?DomFacade=, variables: Object={}, options: {namespaceResolver: function(string):string?}) => Node[]
evaluateXPathToFirstNode(xpath: string, contextNode: Node, domFacade: ?DomFacade=, variables: Object={}, options: {namespaceResolver: function(string):string?}) => Node
evaluateXPathToBoolean(xpath: string, contextNode: Node, domFacade: ?DomFacade=, variables: Object={}, options: {namespaceResolver: function(string):string?}) => boolean
evaluateXPathToNumber(xpath: string, contextNode: Node, domFacade: ?DomFacade=, variables: Object={}, options: {namespaceResolver: function(string):string?}) => number
evaluateXPathToNumbers(xpath: string, contextNode: Node, domFacade: ?DomFacade=, variables: Object={}, options: {namespaceResolver: function(string):string?}) => number[]
evaluateXPathToString(xpath: string, contextNode: Node, domFacade: ?DomFacade=, variables: Object={}, options: {namespaceResolver: function(string):string?}) => string
precompileXPath(xpath: string) => Promise<string>
registerCustomXPathFunction(name: string, signature: string[], returnType: string, callback: function)
Note that this engine assumes XPath 1.0 compatibility mode turned off.
Not all XPath 3.1 functions are implemented yet. We accept pull requests for missing features.
The following features are unavailable at this moment, but will be implemented at some point in time (and even sooner if you can help!):
fn:compare#3
)?
lookup operator for maps and arraystreat as
operatorFor all available features, see the unit tests.
This engine is pretty DOM-agnostic, it has a good track record with the browser DOM implementations and slimdom.js. There are a number of known issues with xmldom because it does not follow the DOM spec on some features including namespaces.
Please refer to the Contribution Guide.
FAQs
A minimalistic XPath 3.1 engine in JavaScript
The npm package fontoxpath receives a total of 36,266 weekly downloads. As such, fontoxpath popularity was classified as popular.
We found that fontoxpath demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.