
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
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 51 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.