npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

niddle

v0.2.5

Published

A super fast html parser and manipulator written in rust.

Downloads

111

Readme

niddleDocs


niddle

Classes

NodeRepr

Constructors

new NodeRepr()

new NodeRepr(): NodeRepr

The node object, cann't be instantiated in javascript. So call the constructor will throw an error.

Returns

NodeRepr

Defined in

index.d.ts:137

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

| Parameter | Type | | ------ | ------ | | newChild | NodeRepr |

Returns

void

Defined in

index.d.ts:18

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

| Parameter | Type | | ------ | ------ | | newChildren | NodeRepr[] |

Returns

void

Defined in

index.d.ts:25

clone()

clone(): NodeRepr

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

Returns

NodeRepr

Defined in

index.d.ts:142

cloneRecursive()

cloneRecursive(): NodeRepr

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

Returns

NodeRepr

Defined in

index.d.ts:147

getAttribute()

getAttribute(name): string

Get attribute value of this node by given name.

Parameters

| Parameter | Type | | ------ | ------ | | name | string |

Returns

string

Defined in

index.d.ts:112

getAttributes()

getAttributes(): Record<string, string>

Get attributes K-V object of this node.

Returns

Record<string, string>

Defined in

index.d.ts:117

getChildren()

getChildren(): NodeRepr[]

Get all children nodes of this node.

Returns

NodeRepr[]

Defined in

index.d.ts:107

innerHtml()

innerHtml(): string

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

Returns

string

Defined in

index.d.ts:127

insertAfter()

insertAfter(newSibling): void

Insert a new sibling after this node.

The sibling node will be remove from its previous position.

Parameters

| Parameter | Type | | ------ | ------ | | newSibling | NodeRepr |

Returns

void

Defined in

index.d.ts:46

insertBefore()

insertBefore(newSibling): void

Insert a new sibling before this node.

The sibling node will be remove from its previous position.

Parameters

| Parameter | Type | | ------ | ------ | | newSibling | NodeRepr |

Returns

void

Defined in

index.d.ts:60

insertSequenceAfter()

insertSequenceAfter(newSiblings): void

Insert some siblings after this node.

These sibling nodes will be remove from their previous position.

Parameters

| Parameter | Type | | ------ | ------ | | newSiblings | NodeRepr[] |

Returns

void

Defined in

index.d.ts:53

insertSequenceBefore()

insertSequenceBefore(newSiblings): void

Insert some siblings before this node.

These sibling nodes will be remove from their previous position.

Parameters

| Parameter | Type | | ------ | ------ | | newSiblings | NodeRepr[] |

Returns

void

Defined in

index.d.ts:67

outerHtml()

outerHtml(): string

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

Returns

string

Defined in

index.d.ts:122

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

| Parameter | Type | | ------ | ------ | | newChild | NodeRepr |

Returns

void

Defined in

index.d.ts:32

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

| Parameter | Type | | ------ | ------ | | newChildren | NodeRepr[] |

Returns

void

Defined in

index.d.ts:39

remove()

remove(): void

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

Returns

void

Defined in

index.d.ts:72

removeAllAttributes()

removeAllAttributes(): void

Remove all attributes of this node.

Returns

void

Defined in

index.d.ts:92

removeAttribute()

removeAttribute(name): void

Remove an attribute of this node by name.

Parameters

| Parameter | Type | | ------ | ------ | | name | string |

Returns

void

Defined in

index.d.ts:87

select()
select(selectors)

select(selectors): NodeRepr

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

Parameters

| Parameter | Type | | ------ | ------ | | selectors | string |

Returns

NodeRepr

Defined in

index.d.ts:97

select(selectors)

select(selectors): NodeRepr

Parameters

| Parameter | Type | | ------ | ------ | | selectors | "html" |

Returns

NodeRepr

Defined in

index.d.ts:150

select(selectors)

select(selectors): NodeRepr

Parameters

| Parameter | Type | | ------ | ------ | | selectors | "head" |

Returns

NodeRepr

Defined in

index.d.ts:151

select(selectors)

select(selectors): NodeRepr

Parameters

| Parameter | Type | | ------ | ------ | | selectors | "body" |

Returns

NodeRepr

Defined in

index.d.ts:152

select(selectors)

select(selectors): NodeRepr

Parameters

| Parameter | Type | | ------ | ------ | | selectors | "html" |

Returns

NodeRepr

Defined in

index.d.ts:155

select(selectors)

select(selectors): NodeRepr

Parameters

| Parameter | Type | | ------ | ------ | | selectors | "head" |

Returns

NodeRepr

Defined in

index.d.ts:156

select(selectors)

select(selectors): NodeRepr

Parameters

| Parameter | Type | | ------ | ------ | | selectors | "body" |

Returns

NodeRepr

Defined in

index.d.ts:157

selectAll()

selectAll(selectors): NodeRepr[]

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

Parameters

| Parameter | Type | | ------ | ------ | | selectors | string |

Returns

NodeRepr[]

Defined in

index.d.ts:102

setAttribute()

setAttribute(name, value): void

Assign an attribute K-V to this node

Parameters

| Parameter | Type | | ------ | ------ | | name | string | | value | string |

Returns

void

Defined in

index.d.ts:77

setAttributes()

setAttributes(attrs): void

Assign attributes K-V object to this node.

Parameters

| Parameter | Type | | ------ | ------ | | attrs | Record<string, string> |

Returns

void

Defined in

index.d.ts:82

text()

text(): string

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

Returns

string

Defined in

index.d.ts:132

Functions

parse()

parse(html): NodeRepr

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

Parameters

| Parameter | Type | | ------ | ------ | | html | string |

Returns

NodeRepr

Defined in

index.d.ts:10