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

niddle

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

niddle

A super fast html parser and manipulator written in rust.

  • 0.2.3
  • Source
  • npm
  • Socket score

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

niddleDocs


niddle

Classes

NodeRepr

Methods
append()

append(newChild): void

Append a child node to this node, after existing children.

The child node will be remove from its previous position.

Parameters
ParameterType
newChildNodeRepr
Returns

void

Defined in

index.d.ts:14

appendSequence()

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.

Parameters
ParameterType
newChildrenNodeRepr[]
Returns

void

Defined in

index.d.ts:20

clone()

clone(): NodeRepr

Clone this node to a new instance, not clone its descendants.

Returns

NodeRepr

Defined in

index.d.ts:90

cloneRecursive()

cloneRecursive(): NodeRepr

Clone this node to a new instance, including its all descendants.

Returns

NodeRepr

Defined in

index.d.ts:92

getAttribute()

getAttribute(name): string

Get attribute value of this node by given name.

Parameters
ParameterType
namestring
Returns

string

Defined in

index.d.ts:74

getAttributes()

getAttributes(): Record<string, string>

Get attributes K-V object of this node.

Returns

Record<string, string>

Defined in

index.d.ts:76

getChildren()

getChildren(): NodeRepr[]

Get all children nodes of this node.

Returns

NodeRepr[]

Defined in

index.d.ts:72

innerHtml()

innerHtml(): string

Get the serialized html of this node, only including its all descendants;.

Returns

string

Defined in

index.d.ts:80

insertAfter()

insertAfter(newSibling): void

Insert a new sibling after this node.

The sibling node will be remove from its previous position.

Parameters
ParameterType
newSiblingNodeRepr
Returns

void

Defined in

index.d.ts:38

insertBefore()

insertBefore(newSibling): void

Insert a new sibling before this node.

The sibling node will be remove from its previous position.

Parameters
ParameterType
newSiblingNodeRepr
Returns

void

Defined in

index.d.ts:50

insertSequenceAfter()

insertSequenceAfter(newSiblings): void

Insert some siblings after this node.

These sibling nodes will be remove from their previous position.

Parameters
ParameterType
newSiblingsNodeRepr[]
Returns

void

Defined in

index.d.ts:44

insertSequenceBefore()

insertSequenceBefore(newSiblings): void

Insert some siblings before this node.

These sibling nodes will be remove from their previous position.

Parameters
ParameterType
newSiblingsNodeRepr[]
Returns

void

Defined in

index.d.ts:56

outerHtml()

outerHtml(): string

Get the serialized html of this node, including its all descendants and itelf;.

Returns

string

Defined in

index.d.ts:78

prepend()

prepend(newChild): void

Prepend a child node to this node, before existing children.

The child node will be remove from its previous position.

Parameters
ParameterType
newChildNodeRepr
Returns

void

Defined in

index.d.ts:26

prependSequence()

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.

Parameters
ParameterType
newChildrenNodeRepr[]
Returns

void

Defined in

index.d.ts:32

remove()

remove(): void

Remove a node from its parent and siblings. Children are not affected.

Returns

void

Defined in

index.d.ts:58

removeAllAttributes()

removeAllAttributes(): void

Remove all attributes of this node

Returns

void

Defined in

index.d.ts:66

removeAttribute()

removeAttribute(name): void

Remove an attribute of this node by name

Parameters
ParameterType
namestring
Returns

void

Defined in

index.d.ts:64

select()

select(selectors): NodeRepr

Select the the fist node that match the given selector, like document.querySelector.

Parameters
ParameterType
selectorsstring
Returns

NodeRepr

Defined in

index.d.ts:68

selectAll()

selectAll(selectors): NodeRepr[]

Select all nodes that match the given selector, like document.querySelectorAll.

Parameters
ParameterType
selectorsstring
Returns

NodeRepr[]

Defined in

index.d.ts:70

setAttribute()

setAttribute(name, value): void

Assign an attribute K-V to this node

Parameters
ParameterType
namestring
valuestring
Returns

void

Defined in

index.d.ts:60

setAttributes()

setAttributes(attrs): void

Assign attributes K-V object to this node

Parameters
ParameterType
attrsRecord<string, string>
Returns

void

Defined in

index.d.ts:62

text()

text(): string

Get all text nodes content of this node, including its all descendants and itelf;.

Returns

string

Defined in

index.d.ts:82

Functions

parse()

parse(html): NodeRepr

Parse string input to a html tree, return the root node.

Parameters
ParameterType
htmlstring
Returns

NodeRepr

Defined in

index.d.ts:7

FAQs

Package last updated on 20 Jul 2024

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