Gathering detailed insights and metrics for postcss-query-ast
Gathering detailed insights and metrics for postcss-query-ast
Gathering detailed insights and metrics for postcss-query-ast
Gathering detailed insights and metrics for postcss-query-ast
npm install postcss-query-ast
75.7
Supply Chain
100
Quality
75.2
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
12 Stars
16 Commits
1 Forks
3 Watching
1 Branches
1 Contributors
Updated on 13 Sept 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
22%
626
Compared to previous day
Last week
11.8%
2,386
Compared to previous week
Last month
-16.3%
8,795
Compared to previous month
Last year
48.4%
84,391
Compared to previous year
2
34
Query PostCSS AST with CSS selectors.
Supported selectors are:
rule
, atrule
, decl
, comment
*
[attr=value]
,
[attr=value]
, [attr~=value]
, [attr|=value]
, [attr^=value]
,
[attr$=value]
, [attr*=value]
rule decl
atrule > rule
rule + rule
rule ~ rule
:first-child
,
:last-child
, :nth-child
,
:nth-last-child
, :only-child
):
rule:first-child
:first-of-type
,
:last-of-type
, :nth-of-type
,
:nth-last-of-type
,
:only-of-type
): rule:first-of-type
rule:empty
:matches(rule, atrule)
:not(atrule)
In addition to standard selectors, there are also custom selectors:
[attr="/^value$/i"]
1npm install postcss-query-ast --save
Querying AST from following CSS will give us only body
rule with jackie
ID
attribute.
1body { 2 background: red; 3} 4 5body#jackie { 6 background: hotpink; 7} 8 9a { 10 background: green; 11}
1import queryAst from 'postcss-query-ast'; 2 3// Assume we have AST 4const postcssAst = []; 5 6(async () => { 7 const ast = await queryAst('rule[selector="body#jackie"]', postcssAst); 8 9 /* [ Rule { 10 raws: { before: '\n\n', between: ' ', semicolon: true, after: '\n' }, 11 type: 'rule', 12 nodes: [ [Declaration] ], 13 parent: 14 Root { 15 raws: [Object], 16 type: 'root', 17 nodes: [Array], 18 source: [Object], 19 lastEach: 1, 20 indexes: {} }, 21 source: { start: [Object], input: [Input], end: [Object] }, 22 selector: 'body#jackie', 23 lastEach: 1, 24 indexes: {} } ] */ 25})();
Returns: Promise<(Root | Rule | AtRule | Declaration | Comment)[]>
Queries PostCSS with CSS selector.
Type: string
CSS selector.
Type: Root
PostCSS AST.
MIT © Ivan Nikolić
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More