# @sika7/silver-html

> this package is provides HTML recursive processing.

Latest version **1.0.1** (published 2021-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sika7/silver-html
pnpm add @sika7/silver-html
yarn add @sika7/silver-html
bun add @sika7/silver-html
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-12-08 |
| First published | 2021-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 2 |
| Unpacked size | 23.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sika7 |
| Maintainers | sika7 |
| Keywords | html, parser, recursive processing |

## Links

- npm: https://www.npmjs.com/package/@sika7/silver-html
- Repository: https://github.com/sika7/silver-html
- Homepage: https://github.com/sika7/silver-html#readme
- Issues: https://github.com/sika7/silver-html/issues
- npm.io page: https://npm.io/package/@sika7/silver-html

## Dependencies (2)

- [parse5](https://npm.io/package/parse5.md) ^6.0.1
- [typescript](https://npm.io/package/typescript.md) ^4.5.2

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-12-08
- 1.0.0 — 2021-12-08
- 0.0.0 — 2021-12-01

## README

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# @sika7/silver-html

this package is Can be recursively deleted or modified. for CommentNode and TextNode and ElementNode.

## Usage

**Step 1:** Install plugin:

```sh
npm install --save @sika7/silver-html
```

**Step 2:** add a functions or plugin.

[use example more](./docs/index.md)

```js
import { silverHtml } from '@sika7/silver-html'

const plugin = {
  pluginName: "devToMain",
  ElementNode: [
    {
      name: "all change tag for main",
      function: (element) => {
        element.tagName = "main";
        return element;
      },
    },
  ],
}
const result = silverHtml("<div>test</div>", {}, [plugin]);
console.log(result)
# <main>test</main>
```

## plugin

plugin config.
```js
const plugin = {
  pluginName: 'pluginName'; // required.
  ElementNode?: (node, level)    => node | null;
  CommentNode?: (comment, level) => node | null;
  TextNode?: (text, level)       => node | null;
}
```

| setting     | description                                    |     | 
| ----------- | ---------------------------------------------- | --- | 
| pluginName  | plugin name.                                   |     | 
| ElementNode | When creating recursive processing of elements |     | 
| CommentNode | When creating recursive processing of comment  |     | 
| TextNode    | When creating recursive processing of text     |     |

---
_Source: https://npm.io/package/@sika7/silver-html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
