Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
This is a modified version of js-xpath. It is adapted for use with TypeScript and is compiled using npm run build
.
npm install ts-xpath
import { XPathParser } from 'ts-xpath';
let parser = new XPathParser();
let parsed = parser.parse("//node");
xpath-models.ts
provides a default XPathModels
which does not support the hashtag preprocessor. If you want to support hashtags within xpaths, you can use:
let hashtagConfig: XPathModels.HashtagConfig = {
isValidNamespace: (namespace: string) => boolean,
hashtagToXPath: (hashtagExpr: string) => string | null,
toHashtag: (xpath: IXPathExpression) => string | null
}
parser.hashtagConfig = hashtagConfig;
hashtags use the format #namespace/arbitrarily/long/path
and do not support filtering
yarn test
to run tests.This is built using a fork of jison. To build the parser file yourself run:
$ yarn build
- This will build both the distribution (webpack
) package in dist/ and rebuild the Jison parser (src/jison/xpath.js
) from the src/jison/
files.
$ yarn jison
- Rebuild parser.js
from the Jison specification files.
For more information on jison see the jison project website at: http://zaach.github.com/jison/.
FAQs
XPath Parser for TypeScript
The npm package ts-xpath receives a total of 67 weekly downloads. As such, ts-xpath popularity was classified as not popular.
We found that ts-xpath demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.