1.0.1 โ€ข Published 12 months ago

@mysticwillz/html-to-string v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

html-to-string

๐Ÿชผ A tiny utility that strips HTML tags from a string and returns clean text.


โœจ Features

  • ๐Ÿฉธ Lightweight โ€“ No dependencies
  • โšก Fast and simple
  • โœ… TypeScript support
  • ๐Ÿ’  Ideal for frontend & backend use

๐Ÿ“ฆ Installation

npm i @mysticwillz/html-to-string

or

yarn add @mysticwillz/html-to-string

๐Ÿš€ Usage

Basic Example

import { stripHTML } from "@mysticwillz/html-to-string";

const dirty = "<h1>Hello <em>World</em></h1>";
const clean = stripHTML(dirty);

console.log(clean); // "Hello World"

๐Ÿง  API

stripHTML(html: string): string

ParamTypeDescription
htmlstringString containing HTML content
โ†’stringClean string with tags removed

๐Ÿงช Example Inputs

stripHTML("<p>This is <strong>important</strong></p>");
// โ†’ "This is important"

stripHTML('<div><a href="#">Link</a></div>');
// โ†’ "Link"

stripHTML("");
// โ†’ ""

๐Ÿ“ Project Structure

html-to-string/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ index.ts      # Main function
โ”œโ”€โ”€ dist/             # Compiled output
โ”œโ”€โ”€ test.js           # Example usage
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ“„ License

MIT ยฉ 2025 Eze Williams Ezebuilo


๐Ÿ’ก Inspiration

This package was built to provide a fast, minimalist solution to convert HTML into plain readable text without unnecessary complexity.


๐Ÿ‘Œ Contributing

Pull requests, suggestions, and ideas are welcome! Open an issue or submit a PR.

1.0.1

12 months ago

1.0.0

12 months ago