Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-select-codsen-parser

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-select-codsen-parser

An adapter for `css-select` to allow querying of `codsen-parser` generated trees.

  • 0.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

css-select-codsen-parser

An adapter for css-select to allow querying of codsen-parser generated trees.

Install

$ npm install css-select-codsen-parser

Usage

To use this adapter, first you must run the AST through prepare.

const parse = require("codsen-parser");
const CSSselect = require("css-select");
const { prepare, adapter } = require("css-select-codsen-parser");

const ast = prepare(
  parse(`
    <div id="greeting">
      Hello <span class="name">Alice</span>
    </div>
  `)
);

const nodes = cssSelect("#greeting .name", ast, { adapter });
// => [ { type: 'tag', start: 37, end: 56, value: '<span class="name">'... ]

API

prepare(ast)

Note: This method modifies the AST directly.

Accepts an AST generated by codsen-parser.

Returns the same AST.

adapter

css-select adapter. See documentation on how to use a custom adapter.

FAQs

Package last updated on 07 Jul 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc