{"id":29766652,"url":"https://github.com/umijs/niddle","last_synced_at":"2025-07-27T01:09:55.672Z","repository":{"id":249268619,"uuid":"828166927","full_name":"umijs/niddle","owner":"umijs","description":"A super fast nodejs addon for html parsing and manipulation written in rust.","archived":false,"fork":false,"pushed_at":"2025-05-22T04:34:43.000Z","size":2741,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T20:49:43.939Z","etag":null,"topics":["htmlparser","jquery","napi","node-addon","rust"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umijs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-13T10:13:29.000Z","updated_at":"2025-05-22T08:57:55.000Z","dependencies_parsed_at":"2024-10-28T01:56:04.445Z","dependency_job_id":"5fe4e6fc-1d53-494a-af64-70d59ae37e6b","html_url":"https://github.com/umijs/niddle","commit_stats":null,"previous_names":["umijs/niddle"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/umijs/niddle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umijs%2Fniddle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umijs%2Fniddle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umijs%2Fniddle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umijs%2Fniddle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umijs","download_url":"https://codeload.github.com/umijs/niddle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umijs%2Fniddle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266597037,"owners_count":23953894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["htmlparser","jquery","napi","node-addon","rust"],"created_at":"2025-07-27T01:09:54.286Z","updated_at":"2025-07-27T01:09:55.666Z","avatar_url":"https://github.com/umijs.png","language":"JavaScript","readme":"**niddle** • **Docs**\n\n***\n\n# niddle\n\n## Classes\n\n### NodeRepr\n\n#### Constructors\n\n##### new NodeRepr()\n\n\u003e **new NodeRepr**(): [`NodeRepr`](README.md#noderepr)\n\nThe node object, cann't be instantiated in javascript. So call the constructor will throw an error.\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n###### Defined in\n\n[index.d.ts:137](https://github.com/umijs/niddle/blob/main/index.d.ts#L137)\n\n#### Methods\n\n##### append()\n\n\u003e **append**(`newChild`): `void`\n\nAppend a child node to this node, after existing children.\n\nThe child node will be remove from its previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newChild` | [`NodeRepr`](README.md#noderepr) |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:18](https://github.com/umijs/niddle/blob/main/index.d.ts#L18)\n\n##### appendSequence()\n\n\u003e **appendSequence**(`newChildren`): `void`\n\nAppend some children nodes to this node by order, after existing children.\n\nThese children nodes will be remove from their previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newChildren` | [`NodeRepr`](README.md#noderepr)[] |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:25](https://github.com/umijs/niddle/blob/main/index.d.ts#L25)\n\n##### clone()\n\n\u003e **clone**(): [`NodeRepr`](README.md#noderepr)\n\nClone this node to a new instance, not clone its descendants.\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n###### Defined in\n\n[index.d.ts:142](https://github.com/umijs/niddle/blob/main/index.d.ts#L142)\n\n##### cloneRecursive()\n\n\u003e **cloneRecursive**(): [`NodeRepr`](README.md#noderepr)\n\nClone this node to a new instance, including its all descendants.\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n###### Defined in\n\n[index.d.ts:147](https://github.com/umijs/niddle/blob/main/index.d.ts#L147)\n\n##### getAttribute()\n\n\u003e **getAttribute**(`name`): `string`\n\nGet attribute value of this node by given name.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n###### Returns\n\n`string`\n\n###### Defined in\n\n[index.d.ts:112](https://github.com/umijs/niddle/blob/main/index.d.ts#L112)\n\n##### getAttributes()\n\n\u003e **getAttributes**(): `Record`\\\u003c`string`, `string`\\\u003e\n\nGet attributes K-V object of this node.\n\n###### Returns\n\n`Record`\\\u003c`string`, `string`\\\u003e\n\n###### Defined in\n\n[index.d.ts:117](https://github.com/umijs/niddle/blob/main/index.d.ts#L117)\n\n##### getChildren()\n\n\u003e **getChildren**(): [`NodeRepr`](README.md#noderepr)[]\n\nGet all children nodes of this node.\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)[]\n\n###### Defined in\n\n[index.d.ts:107](https://github.com/umijs/niddle/blob/main/index.d.ts#L107)\n\n##### innerHtml()\n\n\u003e **innerHtml**(): `string`\n\nGet the serialized html of this node, only including its all descendants.\n\n###### Returns\n\n`string`\n\n###### Defined in\n\n[index.d.ts:127](https://github.com/umijs/niddle/blob/main/index.d.ts#L127)\n\n##### insertAfter()\n\n\u003e **insertAfter**(`newSibling`): `void`\n\nInsert a new sibling after this node.\n\nThe sibling node will be remove from its previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newSibling` | [`NodeRepr`](README.md#noderepr) |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:46](https://github.com/umijs/niddle/blob/main/index.d.ts#L46)\n\n##### insertBefore()\n\n\u003e **insertBefore**(`newSibling`): `void`\n\nInsert a new sibling before this node.\n\nThe sibling node will be remove from its previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newSibling` | [`NodeRepr`](README.md#noderepr) |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:60](https://github.com/umijs/niddle/blob/main/index.d.ts#L60)\n\n##### insertSequenceAfter()\n\n\u003e **insertSequenceAfter**(`newSiblings`): `void`\n\nInsert some siblings after this node.\n\nThese sibling nodes will be remove from their previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newSiblings` | [`NodeRepr`](README.md#noderepr)[] |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:53](https://github.com/umijs/niddle/blob/main/index.d.ts#L53)\n\n##### insertSequenceBefore()\n\n\u003e **insertSequenceBefore**(`newSiblings`): `void`\n\nInsert some siblings before this node.\n\nThese sibling nodes will be remove from their previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newSiblings` | [`NodeRepr`](README.md#noderepr)[] |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:67](https://github.com/umijs/niddle/blob/main/index.d.ts#L67)\n\n##### outerHtml()\n\n\u003e **outerHtml**(): `string`\n\nGet the serialized html of this node, including its all descendants and itelf.\n\n###### Returns\n\n`string`\n\n###### Defined in\n\n[index.d.ts:122](https://github.com/umijs/niddle/blob/main/index.d.ts#L122)\n\n##### prepend()\n\n\u003e **prepend**(`newChild`): `void`\n\nPrepend a child node to this node, before existing children.\n\nThe child node will be remove from its previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newChild` | [`NodeRepr`](README.md#noderepr) |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:32](https://github.com/umijs/niddle/blob/main/index.d.ts#L32)\n\n##### prependSequence()\n\n\u003e **prependSequence**(`newChildren`): `void`\n\nPrepend some children nodes to this node by order, before existing children.\n\nThese children nodes will be remove from their previous position.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `newChildren` | [`NodeRepr`](README.md#noderepr)[] |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:39](https://github.com/umijs/niddle/blob/main/index.d.ts#L39)\n\n##### remove()\n\n\u003e **remove**(): `void`\n\nRemove a node from its parent and siblings. Children are not affected.\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:72](https://github.com/umijs/niddle/blob/main/index.d.ts#L72)\n\n##### removeAllAttributes()\n\n\u003e **removeAllAttributes**(): `void`\n\nRemove all attributes of this node.\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:92](https://github.com/umijs/niddle/blob/main/index.d.ts#L92)\n\n##### removeAttribute()\n\n\u003e **removeAttribute**(`name`): `void`\n\nRemove an attribute of this node by name.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:87](https://github.com/umijs/niddle/blob/main/index.d.ts#L87)\n\n##### select()\n\n###### select(selectors)\n\n\u003e **select**(`selectors`): [`NodeRepr`](README.md#noderepr)\n\nSelect the the fist node that match the given css selector, like document.querySelector.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selectors` | `string` |\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n###### Defined in\n\n[index.d.ts:97](https://github.com/umijs/niddle/blob/main/index.d.ts#L97)\n\n###### select(selectors)\n\n\u003e **select**(`selectors`): [`NodeRepr`](README.md#noderepr)\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selectors` | `\"html\"` |\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n###### Defined in\n\n[index.d.ts:150](https://github.com/umijs/niddle/blob/main/index.d.ts#L150)\n\n###### select(selectors)\n\n\u003e **select**(`selectors`): [`NodeRepr`](README.md#noderepr)\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selectors` | `\"head\"` |\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n###### Defined in\n\n[index.d.ts:151](https://github.com/umijs/niddle/blob/main/index.d.ts#L151)\n\n###### select(selectors)\n\n\u003e **select**(`selectors`): [`NodeRepr`](README.md#noderepr)\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selectors` | `\"body\"` |\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n###### Defined in\n\n[index.d.ts:152](https://github.com/umijs/niddle/blob/main/index.d.ts#L152)\n\n##### selectAll()\n\n\u003e **selectAll**(`selectors`): [`NodeRepr`](README.md#noderepr)[]\n\nSelect all nodes that match the given css selector, like document.querySelectorAll.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `selectors` | `string` |\n\n###### Returns\n\n[`NodeRepr`](README.md#noderepr)[]\n\n###### Defined in\n\n[index.d.ts:102](https://github.com/umijs/niddle/blob/main/index.d.ts#L102)\n\n##### setAttribute()\n\n\u003e **setAttribute**(`name`, `value`): `void`\n\nAssign an attribute K-V to this node\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `name` | `string` |\n| `value` | `string` |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:77](https://github.com/umijs/niddle/blob/main/index.d.ts#L77)\n\n##### setAttributes()\n\n\u003e **setAttributes**(`attrs`): `void`\n\nAssign attributes K-V object to this node.\n\n###### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `attrs` | `Record`\\\u003c`string`, `string`\\\u003e |\n\n###### Returns\n\n`void`\n\n###### Defined in\n\n[index.d.ts:82](https://github.com/umijs/niddle/blob/main/index.d.ts#L82)\n\n##### text()\n\n\u003e **text**(): `string`\n\nGet all text nodes content of this node, including its all descendants and itelf.\n\n###### Returns\n\n`string`\n\n###### Defined in\n\n[index.d.ts:132](https://github.com/umijs/niddle/blob/main/index.d.ts#L132)\n\n## Functions\n\n### parse()\n\n\u003e **parse**(`html`): [`NodeRepr`](README.md#noderepr)\n\nParse string input to a html tree, return the root node.\n\n#### Parameters\n\n| Parameter | Type |\n| ------ | ------ |\n| `html` | `string` |\n\n#### Returns\n\n[`NodeRepr`](README.md#noderepr)\n\n#### Defined in\n\n[index.d.ts:10](https://github.com/umijs/niddle/blob/main/index.d.ts#L10)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumijs%2Fniddle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumijs%2Fniddle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumijs%2Fniddle/lists"}