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.
niddle • Docs
new NodeRepr():
NodeRepr
The node object, cann't be instantiated in javascript. So call the constructor will throw an error.
append(
newChild
):void
Append a child node to this node, after existing children.
The child node will be remove from its previous position.
Parameter | Type |
---|---|
newChild | NodeRepr |
void
appendSequence(
newChildren
):void
Append some children nodes to this node by order, after existing children.
These children nodes will be remove from their previous position.
Parameter | Type |
---|---|
newChildren | NodeRepr [] |
void
clone():
NodeRepr
Clone this node to a new instance, not clone its descendants.
cloneRecursive():
NodeRepr
Clone this node to a new instance, including its all descendants.
getAttribute(
name
):string
Get attribute value of this node by given name.
Parameter | Type |
---|---|
name | string |
string
getAttributes():
Record
<string
,string
>
Get attributes K-V object of this node.
Record
<string
, string
>
getChildren():
NodeRepr
[]
Get all children nodes of this node.
NodeRepr
[]
innerHtml():
string
Get the serialized html of this node, only including its all descendants.
string
insertAfter(
newSibling
):void
Insert a new sibling after this node.
The sibling node will be remove from its previous position.
Parameter | Type |
---|---|
newSibling | NodeRepr |
void
insertBefore(
newSibling
):void
Insert a new sibling before this node.
The sibling node will be remove from its previous position.
Parameter | Type |
---|---|
newSibling | NodeRepr |
void
insertSequenceAfter(
newSiblings
):void
Insert some siblings after this node.
These sibling nodes will be remove from their previous position.
Parameter | Type |
---|---|
newSiblings | NodeRepr [] |
void
insertSequenceBefore(
newSiblings
):void
Insert some siblings before this node.
These sibling nodes will be remove from their previous position.
Parameter | Type |
---|---|
newSiblings | NodeRepr [] |
void
outerHtml():
string
Get the serialized html of this node, including its all descendants and itelf.
string
prepend(
newChild
):void
Prepend a child node to this node, before existing children.
The child node will be remove from its previous position.
Parameter | Type |
---|---|
newChild | NodeRepr |
void
prependSequence(
newChildren
):void
Prepend some children nodes to this node by order, before existing children.
These children nodes will be remove from their previous position.
Parameter | Type |
---|---|
newChildren | NodeRepr [] |
void
remove():
void
Remove a node from its parent and siblings. Children are not affected.
void
removeAllAttributes():
void
Remove all attributes of this node.
void
removeAttribute(
name
):void
Remove an attribute of this node by name.
Parameter | Type |
---|---|
name | string |
void
select(
selectors
):NodeRepr
Select the the fist node that match the given css selector, like document.querySelector.
Parameter | Type |
---|---|
selectors | string |
select(
selectors
):NodeRepr
Parameter | Type |
---|---|
selectors | "html" |
select(
selectors
):NodeRepr
Parameter | Type |
---|---|
selectors | "head" |
select(
selectors
):NodeRepr
Parameter | Type |
---|---|
selectors | "body" |
select(
selectors
):NodeRepr
Parameter | Type |
---|---|
selectors | "html" |
select(
selectors
):NodeRepr
Parameter | Type |
---|---|
selectors | "head" |
select(
selectors
):NodeRepr
Parameter | Type |
---|---|
selectors | "body" |
selectAll(
selectors
):NodeRepr
[]
Select all nodes that match the given css selector, like document.querySelectorAll.
Parameter | Type |
---|---|
selectors | string |
NodeRepr
[]
setAttribute(
name
,value
):void
Assign an attribute K-V to this node
Parameter | Type |
---|---|
name | string |
value | string |
void
setAttributes(
attrs
):void
Assign attributes K-V object to this node.
Parameter | Type |
---|---|
attrs | Record <string , string > |
void
text():
string
Get all text nodes content of this node, including its all descendants and itelf.
string
parse(
html
):NodeRepr
Parse string input to a html tree, return the root node.
Parameter | Type |
---|---|
html | string |
FAQs
A super fast html parser and manipulator written in rust.
The npm package niddle receives a total of 3 weekly downloads. As such, niddle popularity was classified as not popular.
We found that niddle 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
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.